Hello,
Question:
- How do I remove a Param from the URL from within the application?
The Param() docs are scant and haven't been updated in 5 years (!). Need community help on this one!
Scenario:
- OnVisible of App:
If(
!IsBlank(Param("testNumber")),
Set(varTestNumber, Param("testNumber"));
Navigate(scrSearch)
)
- OnVisible of scrSearch:
If(
IsBlank(Param("testNumber")),
Set(varTestNumber, Blank()),
Set(varTestNumber, Param("testNumber"));
Select(icnSearch)
)
- This executes a search and the URL works very well as a "tap-out" from a legacy system.
Problem:
- If user clicks the "Back" or "Cancel" button and wishes to perform a manual search, `Param("testNumber")` remains in the URL
- This causes a loop where the user cannot perform a new search due to `varTestNumber` being set automatically based on the URL
Thanks
Solved! Go to Solution.
Thanks for the reply @chsanche . I found a work around. Its a not the most eloquent, but works:
Solution:
- OnSelect of "Cancel" or "Back" button (after user has come into the app via Parameterized URL):
If(
IsBlank(
Param("testNumber")
),
Navigate(scrStart, Fade),
Launch("https://apps.powerapps.com/play/<yourAppIdHere>?tenantId=<yourTenantIdHere>&hidenavbar=true")
)
- Translates to:
- IF the user came into this screen using the traditional workflow, just navigate them back to the start screen
- ELSE relaunch the app without the Param() in the URL
Hope this helps others!
Hi @ericonline
I don't think this is going to be possible. PowerApps has limited functionality to modify the browser's resources, for example, PowerApps is able to launch a new tab but is not able to close a tab, I tried to search for this information in our documentation but got into the same URL you are indicating.
Unfortunately, I don't think we have this feature available for now.
Best Regards,
--
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions help users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Thanks for the reply @chsanche . I found a work around. Its a not the most eloquent, but works:
Solution:
- OnSelect of "Cancel" or "Back" button (after user has come into the app via Parameterized URL):
If(
IsBlank(
Param("testNumber")
),
Navigate(scrStart, Fade),
Launch("https://apps.powerapps.com/play/<yourAppIdHere>?tenantId=<yourTenantIdHere>&hidenavbar=true")
)
- Translates to:
- IF the user came into this screen using the traditional workflow, just navigate them back to the start screen
- ELSE relaunch the app without the Param() in the URL
Hope this helps others!
Create variables for each Param.
Use the Variable as the default for the controls.
When you click back or cancel set the variables to blank or another default value.
Presumably this problem happens on a deep link. I solved this by first checking as the screen loads (Screen.OnVisible) by setting the variable from the Param only when the variable is null (IsBlank). If, when returning to the screen from another place in the app where the variable is already set, this command is ignored.
If(
//Checks to see if the Param is populated and the variable is blank.
//This happens when entering the app through a "deeplink".
!IsBlank(Param("p_selectedID")) And IsBlank(varSelectedID),
//Sets the variable to the value of the Param.
//I use the "Value" function to convert the text of the number in the pass Param to number.
Set(varSelectedID,Value(Param("p_selectedID"))),
//When both conditions are not met, nothing else happens.
1=1);
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.
User | Count |
---|---|
193 | |
45 | |
44 | |
38 | |
35 |
User | Count |
---|---|
262 | |
82 | |
81 | |
70 | |
67 |