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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Create parameter based...
Power Apps
Unanswered

Create parameter based on record ID

(0) ShareShare
ReportReport
Posted on by 64

Hello! 

 

I'd like Flow to generate an email with a link to a record in my PowerApp using parameters. I believe my Flow is working correctly, but I'm having a hard time creating the parameter based on the ID of the record. 

 

My record uses the variable VarCanvasData as my selected record.

I'd like my Parameter to be "canvasid" followed by the ID number. If there is a canvasid, go to the executive summary screen, otherwise go to the canvas dashboard (home screen)

 

OnStart: 

Set(VarCanvasID, Value(Param("canvasid")));
If(VarCanvasID <> 0, Set(VarCanvasData, LookUp(Efforts, ID = VarCanvasID)); 'Executive Summary')

 

StartStreen:

If(
IsBlank(Param("canvasid")), 'Canvas Dashboard', 'Executive Summary')

 

If I add a label with the text as "VarCanvasID" it doesn't show anything, so I think I'm missing something to actually grab the ID from the selected record. My Flow seems to generate the URL as expected, but it doesn't actually populate data based on the record it should be displaying.

 

I hope this makes sense 🙂 Please let me know if there is any other information that would be helpful! Thank you!

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @JennC26 

    Are you sure your parameter is correct in the URL?  If so, then your VarCanvasID should have a value.  If it is not correct in the URL, then the VarCanvasID will be blank.

    I would double check your URL parameters.

    I hope this is helpful for you.

  • JennC26 Profile Picture
    64 on at

    Thanks for your response! I think my URL is correct - https://apps.powerapps.com/play/<appinfohere>&canvasid=156. When I do this, my label on the screen shows 156 as my ID, but nothing else from the record shows up, so I'm stumped. Any other hints or would screenshots be helpful?

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @JennC26 

    Well, I am a little confused then...you said in the original post that "If I add a label with the text as "VarCanvasID" it doesn't show anything,..."  But now you are saying that you DO see a value?

     

    So if you are getting a value, then the lookup should occur based on that.  I looked over your formula again and am baffled by what you have as it does not seem to be syntactically correct.

        If(VarCanvasID <> 0, Set(VarCanvasData, LookUp(Efforts, ID = VarCanvasID)); 'Executive Summary')

     

    What is the part in red about?  That would seem to indicate and error in the formula and thus the whole OnStart would not evaluate.

     

     

  • JennC26 Profile Picture
    64 on at

    Hi @RandyHayes, thanks for bearing with me here, and sorry for the confusion. Let me try to clean up my messages a little. 

     

    When I'm in edit/test mode of the app, and click on one of my records (kicking off the VarCanvasData variable), it populates the record as expected on my executive summary screen, but my VarCanvasID label doesn't show anything (it should bring up my canvas #156 and show the label as 156).

    AppOnStart.pngExecSummaryNoID.png

     

     

    On the other hand, if I try to launch my app via URL using the parameter canvasid=156 to go to that same canvas#156 (https://apps.powerapps.com/play/<appinfohere>&canvasid=156) the app will take me to the executive summary screen, but the record doesn't show any details, BUT my VarCanvasID label displays as 156. Of course this morning I can't grab a screenshot of this because I've tried tweaking my code every which way to see if I can get it to work with no luck, but I promise I've seen it actually populate the VarCanvasID, but only using the URL, not during the editing experience.

     

    So I think I'm doing something right, but missing something else. Do you spot any errors or other tweaks I should try making? Need more screenshots? I really appreciate you following up on this - hoping it's a simple fix that's right in front of my face 😀

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @JennC26 

    Okay...thanks for clarifying more.  

    Yes, during edit, your VarCanvasID will be empty because there are not parameters passed when in Edit.

     

    However, your formula still is not correct and I don't understand why you have 'Executive Summary' in that formula.

    RandyHayes_0-1658500722677.png

     

    Where is that Formula being used (what property) and what is the purpose of the Executive Summary in it?

  • JennC26 Profile Picture
    64 on at

    Executive Summary is the screen I was trying to direct to if there is a canvasid identified, but maybe it doesn't go in the OnStart? I also have this code in the StartScreen: 

    If(IsBlank(Param("canvasid")), 'Canvas Dashboard', 'Executive Summary')

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @JennC26 

    Your StartScreen formula is fine then.

    Change your OnStart to:

    Set(VarCanvasID, Value(Param("canvasid")));
    Set(VarCanvasData, LookUp(Efforts, ID = VarCanvasID))
  • JennC26 Profile Picture
    64 on at

    @RandyHayes We're closer, I think! 

     

    My label shows VarCanvasID, but still doesn't populate my record. This is one of those love/hate PowerApps days - it's got to be right in front of us, right?? 

    ExecSummaryCanvasID.png

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @JennC26 

    Try to check it all in the edit environment.  You can't pass a parameter, but you can emulate it.  Change OnStart to:

    Set(VarCanvasID, Value("156"));
    Set(VarCanvasData, LookUp(Efforts, ID = VarCanvasID))
  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @JennC26 

    Oh, then make sure you run the OnStart again in your designer.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard