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
Best Answers
-
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.
Results of javascript query
5 -
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.
1
Answers
-
That's awesome!!
Thanks a lot for this tip.
Regards,
Hayk
0 -
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
Hope this helps
David
0 -
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
0 -
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?
0 -
Thank you Greg, that works!
1