cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ericonline
Community Champion
Community Champion

How to clear URL Param()?

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

1 ACCEPTED SOLUTION

Accepted Solutions
ericonline
Community Champion
Community Champion

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!

View solution in original post

2 REPLIES 2
chsanche
Community Support
Community Support

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!

If this post helps you give a :thumbs_up: and if it solved your issue consider Accept it as the solution
ericonline
Community Champion
Community Champion

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!

View solution in original post

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

PowerPlatform 768x460.png

Microsoft Learn

Check out our new Discover Your Career Path blog post series and get all the details.

Users online (1,173)