Hi All,
I'm running into the strangest issue with the Param() function as it doesn't seem to capture the passed value. The URL I'm using looks like this:
https://apps.powerapps.com/play/[appId]?tenantId=[tenantId]?Document=[TextValue]
The code I have in my OnStart and StartScreen wasn't working as the users are not navigated to the expected screen (screen2), showing the expected data (variable). I then added a label to see what value was passed with Param (Document) and it seems to be a blank, regardless of what I pass for TextValue.
OnStart = If(IsBlank(Param(Document)),true,Set(variable,LookUp([DataSource], Title=Param(Document)))
StartScreen = If(IsBlank(Param(Document)),Screen1,Screen2)
TSLabel Text = Param(Document)
What am I missing?
Sometimes it's hard to see the forest from the trees 😁
Yep, that is what I missed... Thanks!
And same in your StartScreen...need quotes there too.
Oh sorry, should have put in quotes:
Set(variable, LookUp([DataSource], Title=Param("Document")))
Hi @RandyHayes,
Thanks for the quick reply and the tips on streamlining the OnStart.
Sorry I failed to mention I did try the ampersand with the same result:
https://apps.powerapps.com/play/[AppId]?tenantId=[tenantId]&Document=[TextValue]
Your parameter in the url needs an ampersand, not a question mark.
i.e.
https://apps.powerapps.com/play/[appId]?tenantId=[tenantId]&Document=[TextValue]
Also, you can alter the OnStart to the following:
Set(variable, LookUp([DataSource], Title=Param(Document)))
Your variable will be blank if there is no param...which is the same as you had in your other formula. So, you can cut out the extra parts.
Your StartScreen is already referring to the param value, so that will all be fine.
I hope this is helpful for you.
WarrenBelz
146,522
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,890
Most Valuable Professional