web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Model Driven App Custo...
Power Apps
Unanswered

Model Driven App Custom Pages, Passing multiple parameters

(0) ShareShare
ReportReport
Posted on by 467

Hello, I have built a custom page to compliment our Model App.  This application launches from the Main form or from a project record within our model application.  

 

The Architecture of the custom page (Canvas app) application requires the use of several screens and based upon a value on the Parent model app form (Project Record) a specific canvas page should load.  From all the documentation I have read the integration seems to be passing the model app recordid of the current record over to the canvas app and this makes a lot of sense.   Within your appstart once you have the record id you could in-turn perform a lookup of this record providing the values of the record resulting in additional logic such as if statements to determine the appropriate screen navigation.

 

Now if one were to switch over to the newer app.startscreen this seems to take on a different approach where if I can pass the parameter of the value that I would use for logic to drive the screen navigation we can achieve much quicker app loading times.

 

So what I am looking to do here is grab a value from the model app form, this form may not be saved yet, pass this value over to the custom page (Canvas App) which would allow for better use of the app.startscreen method for improved performance.

 

I was playing around with the javascript used for custom pages and it seems like you can hijack the record id however this is now the only value you are returning

recordId: Xrm.Page.data.entity.getId() - Default
 recordId: Xrm.Page.getControl(parameter).getName() - Tested and works
 
My goal here is to continue returning the recordid however return an additional parameter from the form without having to perform a lookup on the record id from the canvas app as it's highly possible the model form is not yet saved.
Categories:
I have the same question (0)
  • meelamri Profile Picture
    468 on at

    Hi @Dudditz

     

    I managed to pass a JSON from the app to the custom page. I share all the details on my blog. I think it will help. 

    https://xrmtricks.com/2021/10/25/how-to-pass-an-object-from-a-model-driven-to-a-custom-page/

  • Dudditz Profile Picture
    467 on at

    Hi melarmi, I actually tested out your post a few weeks ago and it seemed like the parsing was no longer working correctly.  I will try to rebuild this and see if it was something I did wrong at the time.  That said, this procedure is also setting global variables which are not compatible with the new app.startscreen however I am still interested in making this work as I have other projects that will require more than one parameter.   I find it odd that dynamically launching a screen within a custom page would require this level of work around.  I feel like I am missing something somewhere as passing a url parameter to a canvas app is common practice however how to do something similar with a custom page such as a value from a model app form.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    You are correct, parsing of json is missing a few characters in melamri's post. In powerapps it should look like this: 

     

    arevsun_1-1657136090690.png

    I agree with you that it should have been easier sending multiple parameters to a canvas page. 

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This was a smart workaround, thanks @melamri !

  • meelamri Profile Picture
    468 on at

    Thank you for your feedback.
    On my side, the formula was working properly. It may be that things have changed in the meantime.

    In any case, this is a workaround until we have a more elegant way. Thank you once again!

  • NKC Profile Picture
    on at

    Hi,

    I tried above its not working. See below. Is there any workaround to pass multiple parameters from Dynamics 365. I am getting value into input parameters but match is not working. 

     

    Capture.PNG

  • matt32 Profile Picture
    2 on at

    Hi krishna9,

    I had the same problem but got it working by removing the JSON function in my canvas app, so my code was like this:

    Set(inputParameters, Param("recordId"));

  • brownman311 Profile Picture
    37 on at

    Thanks for the tip @melamri! All of those quotes and commas were making my head spin...I found it easier to just use ParseJSON() to set them in my variables. Hope this helps the next dev!

     

    My recordID in JavaScript

    recordId: JSON.stringify({ firstParameter: varRecordId, secondParamter: varSourceControlName.toString() })

    PowerFx app.OnStart

    Set(varRecordOfFirstParameter,
     If(IsBlank(GUID(ParseJSON(Param("recordId")).firstParamter))),
     Blank(),
     LookUp(Clients, 'Client Id' = GUID(
     ParseJSON(Param("recordId")).firstParamter)) //get First parameter value from recordId
     )
    );
    
    Set(varSecondParam,
     If(IsBlank(Text(ParseJSON(Param("recordId")).secondParameter)),
     Blank(),
     Text(ParseJSON(Param("recordId")).secondParameter) //get the value of the second parameter
     )
    );

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 404

#2
timl Profile Picture

timl 344 Super User 2026 Season 1

#3
WarrenBelz Profile Picture

WarrenBelz 320 Most Valuable Professional

Last 30 days Overall leaderboard