Retrieving Item ID from Dimension ID (Transactional API) from model front-end

Hi,

 

We have a current use case where we are retrieving module data for a specific object within a list, and achieving this through the use of the transactional APIs (querying the view). We have the view structured such that the dimension for the object that we want to retrieve is in the "Pages" segment of the view. This then allows us to specify a specific item ID for that dimension. We trigger this via a weblink that is published to the front end, that triggers a GET request, where the code of the item is part of the parameters of the call. 

 

Retrieving the specific item ID however is a bit of a pain, as we are then required to loop through the returned list of item IDs from the /dimension/<dim_id>/items call, using the code of the item that was previously sent as a parameter. We've thought about caching the results, such that we do not always have to run through the full list of item IDs, but was wondering if there were any other ways that people have implemented. 

 

We've found that there's a specific pattern for numbered lists (the Item IDs are formatted in a way that it's some dimension ID, and then the internal Anaplan ID (#, but is there anyway to get the item ID from the model itself? 

Answers

  • @kevin.cho 

    If I understand the question correctly there is an item LIST in a module and you want to obtain the CODE in your export file. I'm also assuming that you want this in the same export that you have today vs using a system module that contains the item properties, such as CODE (this would be  best practice)

    1. In your module, add a line item subsidiary view that only uses the item LIST in the "applies to", formatted as text, and it's function is CODE(ITEM([Name of your item LIST])
    2. add this line item to your saved view that you are using for the export
    3. Manually run the export using the same name of the action that you refer to in the RESTful API, and make sure you run it as "EVERYONE"
    4. Try your Export/Download API request again.

    Hope this is what you're after. If not, send another message. 

  • Hey @JaredDolich , not exactly.

     

    We're retrieving data from a specific module view using the transactional APIs that were introduced 2020. Anaplan Integration API V2 Guide and Reference · Apiary Easily access and process granular data with Trans... - Anaplan Community

     

    The URL of the call to retrieve data from a view is:

    /models/{modelId}/views/{viewId}/data?pages={dimensionId:itemId}&format=v1

     

    We're trying to determine an easier way to retrieve the itemId from the front-end of the model (e.g. be able to pull it out into a module through a line item or other). 

     

     

     

  • Hello, do you know how to get the viewid? I'm struggling to find some clear documentation/how-to's on this.

    Many thanks,
    Chad
  • Refer to this documentation to retrieve the view IDs: https://anaplanbulkapi20.docs.apiary.io/#RetrieveIDNamesViewsModel 

     

    A prescriptive how-to guide will depend on which tool you're using to make the API call. 

     

    What you want is a GET call to /model/{modelId}/views which will return a JSON object as a list of all the views in your model. The name of the view is in the format <module name>.<view name>

     

    If you want to just get the views in a specific module, you can use /models/{modelId}/modules/{moduleId}/views

  • coraquinn
    edited January 4

    @pico park first create a new module and include the list for which you want to retrieve item IDs as a dimension in the module. And after you can add other dimensions as needed based on your requirements.