cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Super User
Super User

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
Highlighted
Super User
Super User

Re: How to clear URL Param()?

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
Highlighted
Microsoft
Microsoft

Re: How to clear URL Param()?

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!

Highlighted
Super User
Super User

Re: How to clear URL Param()?

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
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

Top Solution Authors
Top Kudoed Authors
Users online (8,101)