UX source model auto updater

Author: Abhishek Roy is a Certified Solution Architect , Sr. Platform Architect at Equinix and a member of their Anaplan CoE team.

This article primarily covers a less explored API functionality that the Anaplan UX is based on and adds an element of automation and easy configuration to the otherwise manual time-taking and error-prone activity of updating source models for UX Apps.

Problem statement

We are already aware of the fact that Anaplan UX pages are pointed to models that help them display the data / visualizations set up by the page builders.

In scenarios where a UX application needs to be duplicated and pointed to another model
(generally, a deployed variant / copy of the standard model) there are typically only two ways to achieve the same.

  1. Navigate to the Page settings and change the source model definition.
  2. Open Manage Models from the App default landing page and configure on page-by-page basis.

With both of the options comes the possibility of missing out repointing a couple or more pages and additionally it becomes very cumbersome for apps that have evolved over time and have close to 50+ pages pointed to a variety of models (e.g. Datahub, Spoke 1, Spoke 2 etc).

This solution has been created to address the automation and reduce the error possibility of this activity that most teams face as of today.

Solution overview

Anaplan Springboard API will be leveraged as part of automating the page updates for UX.

This is an API functionality that enables us to directly update parameters of the UX pages like the modelID & the workspaceID it is pointed to.

Sample API cURL’s for Springboard API

Here are few of the sample API cURL that involve using springboard functionality.

  1. API GET request to get a list of all the Pages and their details associated to an App
    curl --location 'https://us1a.app.anaplan.com/a/springboard-definition-service/apps/{AppID}
    The AppID can be easily retrieved from the URL while we are on the default landing page of any UX App. Response: The Page Identifier PageID can be retrieved from this request.
  2. API GET request to get the Model details of any page using the PageID.
    curl --location 'https://us1a.app.anaplan.com/a/springboard-definition-service/pagemodels/PageID
    \--header 'Authorization: ••••••' \
    The PageID can be obtained via API request as mentioned in step 1 or can also be taken from the URL when on the desired page. Response:
  3. API PUT request to point the Pages to any intended Model
    curl --location --request PUT 'https://us1a.app.anaplan.com/a/springboard-definition-service/pagemodels/{PageID}'\
    --header 'Content-Type: application/json'\
    --header 'Authorization: ••••••'
    --data '{
    "pageModels": [
    {
    "modelId": "ModelID",
    "workspaceId": "WorkspaceID"
    }],
    "isAlmEnabled": true
    }'
    Response:

As showcased in the steps mentioned above — while it’s possible to get the redirection done via the API calls — this is on a page-by-page basis and will need the parameters like PageID, ModelID, WorkspaceID, etc. to be dynamic as these are identifiers that change whenever we are copying the models or Applications. Additionally, the details of the target model need to be supplied to the API for completing the execution of this request.

This solution takes the dynamic nature into consideration and has the API calls being generated with variables declared on the fly and bundles a looping and referential nature to ensure the same process is carried over for all the pages in the mentioned App that needs to be redirected to the target model.

Due to the size of this guide, we've created a demo video and a downloadable PDF with step-by-step instructions.

Please download the guide here:

And the video can be seen here:

Questions? Leave a comment!

…..

Acknowledgements

I would like to take this opportunity to thank few key contributors who have been instrumental in ideating, implementing, and documenting this solution:

Tagged:

Comments