How to get "hierarchyEntityLongId" (List id which appears if you copy-paste list format to excel)

Contributor

How to get "hierarchyEntityLongId" (List id which appears if you copy-paste list format to excel)

Hi all,

 

Excel is very handy for "mass" analysis/amendments of line items. However, for List formatted line items I get List ID (instead of name) in "Format" column. It happens both when you copy-paste or export blueprint for all line items. It is very annoying to manually map these IDs to list names. Screenshots are below.

 

Is there any way I can retreive these List IDs and their names?

 

Thanks,

Hayk

 

SCR1.PNG

 

SCR2.PNG

Message 1 of 8
7 REPLIES 7

Re: How to get "hierarchyEntityLongId" (List id which appears if you copy-paste list forma

Thanks for asking this question - I'm sure a lot of people have wondered a similar thing. The information you need is all available in the application but is not exposed on the grids. I had a go at a solution that seems to work. I would be interested to learn if it suits your needs.

 

If you are happy with using the developer tools in Chrome then pasting the following javascript code into the console 

 

window.anaplan.data.ModelContentCache._modelInfo.hierarchiesInfo.hierarchiesLabelPage.entityLongIds[0].forEach((e,i) => console.log(e + ' ' + window.anaplan.data.ModelContentCache._modelInfo.hierarchiesInfo.hierarchiesLabelPage.entityIds[0][i]))

window.anaplan.data.ModelContentCache._modelInfo.hierarchySubsetsInfo.hierarchySubsetsLabelPage.entityLongIds[0].forEach((e,i) => console.log(e + ' ' + window.anaplan.data.ModelContentCache._modelInfo.hierarchySubsetsInfo.hierarchySubsetsLabelPage.entityIds[0][i]))

That will give output similar to the below screenshot. I've included lists and list subsets.

Screen Shot 2018-05-22 at 16.37.58.pngResults of javascript query

Message 2 of 8
Contributor

Re: How to get "hierarchyEntityLongId" (List id which appears if you copy-paste list forma

That's awesome!!

 

Thanks a lot for this tip.

 

Regards,

Hayk

Message 3 of 8
Community Boss

Re: How to get "hierarchyEntityLongId" (List id which appears if you copy-paste list forma

Hi

The other more "low tech" method is to sert up a module with a line item representing each list. Format the line item as the list in question.  When you copy out the blueprint, you will ge the line item (i.e. list name) and the GUID

 

2018-05-23_09-31-51.png

 

2018-05-23_09-32-14.png

 

 

 

 

Hope this helps

David

Message 4 of 8
Contributor

Re: How to get "hierarchyEntityLongId" (List id which appears if you copy-paste list forma

Hi,

 

Thanks for your advice. That is how I've been doing it previously.

But console is less time consuming if you have many lists to set.

 

Regards,

Hayk

Message 5 of 8
Occasional Contributor

Re: How to get "hierarchyEntityLongId" (List id which appears if you copy-paste list forma

Hello Greg,

 

 The ids for the line item subsets can also be queried as you say. But as the line items are not part of the standard info and label pages, is there a way to fetch the complete list of line item entity ids in a similar way as above?

Message 6 of 8

Re: How to get "hierarchyEntityLongId" (List id which appears if you copy-paste list forma

Hi Aleph,

That's not quite as straightforward, but I managed it with the following snippet.

 

 

window.anaplan.data.ModelContentCache._modelInfo.modulesLabelPage.entityLongIds[0].forEach(function(e,i) {console.log(e + ' ' + window.anaplan.data.ModelContentCache._modelInfo.modulesLabelPage.entityIds[0][i]);window.anaplan.data.ModelContentCache.getLineItemsLabelPage(e).entityLongIds[0].forEach(function(le,li) {console.log(le + ' ' + window.anaplan.data.ModelContentCache.getLineItemsLabelPage(e).entityIds[0][li]);})})

 

You can see some sample output below. Each line item is below its parent module - the modules all have entity long Ids that begin with 102. Line Items will start at 200 and go higher.

 

 

Screen Shot 2019-01-14 at 17.15.08.png

Message 7 of 8
Highlighted
Occasional Contributor

Re: How to get "hierarchyEntityLongId" (List id which appears if you copy-paste list forma

Thank you Greg, that works!

Message 8 of 8