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

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

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (85,489)