New UX Idea - Apply one more model source to all pages of the app at once

One of our model a dev and multiple prod models linked to a single dev via ALM.

We have developed New UX App based on dev with a lot of pages in it.

My aim now is to apply all prod models we have to this app, but the existing procedure is not effective for this idea.

I want to have ability to add new source to the excising app globally without need to select each page one by one.

Per each page i will have to click at least 8 times which is too big waste of time.

KirillKuznetsov_1-1614596438459.png

 

 

35
35 votes

New · Last Updated

Comments

  • I wrote a script to do this, given two lists, one of source models, and one of target pages. PM me for more info 🙂 

  • Also had this problem. It was really exhausting to add all needed pages to each model!

  • Definitely needed. @kevin.cho I will contact you re: the script, if that's ok :-)

  • Agreed - not having this function blocks use cases we where we need to cut a version of a model for scenarios/other modelling (creating an app copy and updating over a 100 page sources, one at a time, isn't really a viable option).

    As a result, these models need to stay in classic for now.

  • kevin.cho
    edited June 4

    Just leaving this here - the call to update this via the API is:

    PUT 
    https://us1a.app.anaplan.com/a/springboard-definition-service/pagemodels/{page_id}
    

    request body is a json payload with structure:

    pageModels is an array of objects with modelId and workspaceId as keys

    updated_model_payload = {}
    updated_model_payload['pageModels'] = [{'modelId': '{your_model_id_to_update}', 'workspaceId': '{your_workspace_id_to_update}'}]
    updated_model_payload['isAlmEnabled'] = True

    isAlmEnabled allows multiple models to be set. If you only need one, then you can set this to False.

    Request headers is at minimum Authorization with AnaplanAuthToken - similar to other Anaplan API requests

  • Hi @kevin.cho - thank you for sharing this information.

    Took a pass at this and was trying to set it up on the postman call to update an App for enabling Multi-Model on a pair of standard/deployed models.

    Ended up with 401 Unauthorized. (Already checked that I am able to run regular API calls to the Model)

    Can you confirm if the page id is being taken from the App URL?

    Eg: - If below is the URL for a page I am currently viewing

    https://us1a.app.anaplan.com/a/apps/app/1e067334-23da-4e6d-9f3a-dce3d51b86c8/boards/f378b8cf-a337-4ae5-a81a-ca2b03e76546

    Is the Page ID f378b8cf-a337-4ae5-a81a-ca2b03e76546 ?

    Here is what I had configured in the POSTMAN - I also suspect the Body itself might have an error.

  • kevin.cho
    edited June 4

    Yeah your body is formatted incorrectly. My example above wasn't meant to be copied directly, you need to pass a json payload instead. My code was just ripped from my existing Python script.

    These curl statements might help explain it cleared

    curl --location --request GET 'https://us1a.app.anaplan.com/a/springboard-definition-service/apps/{app id}' \
    --header 'Authorization: AnaplanAuthToken {{token}}'
    

    To update pages:

    curl --location --request PUT 'https://us1a.app.anaplan.com/a/springboard-definition-service/pagemodels/{page id}' \
    --header 'Authorization: AnaplanAuthToken {{token}}' \
    --header 'Content-Type: application/json' \
    --data-raw '{
        "pageModels": [
            {
                "modelId": "{model_id}",
                "workspaceId": "{workspace_id}"
            },
            {
                "modelId": "{model_id}",
                "workspaceId": "{workspace_id}"
            }
        ],
        "isAlmEnabled": true
    }'
    

    You can import these curl statements directly into Postman and then update the {parameters} as you wish.

  • abroy
    edited June 4

    Hi @kevin.cho - thank you for the response and the cURLs - I did import those and updated the params too.

    It is working and I was able to run them! Thanks again!

  • Hi @kevin.cho - just out of curiosity - I was trying to implement an automation idea of getting all the list of page id's for a particular app and then get them updated in a cyclic fashion.

    One edge case that comes to my mind is most apps will have a combination of Hub / Spoke Pages. In this case - have you explored any segregation logic that will ensure that only the intended pages we want to update are taken in the cyclic update.

    Eg:-

    App has 4 pages - 2 pointed to DH Dev and 2 to Spoke Dev

    I update my logic with the WS & Model ID for DH Dev and DH QA and the app id

    1. Logic first fetches all the pages for the app id passed - 4 pages received
    2. Segregates only page id's that are currently pointed to DH Dev so our operating pool is now - 2 pages
    3. Now the logic for the springboard should only take those 2 pages and get them updated to DH Dev and DH QA

  • This should really be an out of the box functionality. Does anyone know if it's on the roadmap ?

  • PS The out of the box functionality should also allow to remove models as source from one, more or ALL pages , in bulk.

    This is to prevent this issue :

    causing the "Manage Models" functionality to stop working

Get Started with Idea Exchange


See our Submission Guidelines and Idea Evaluation Criteria, then start posting your own ideas and showing support for others!