web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / How to clear URL Param()?
Power Apps
Answered

How to clear URL Param()?

(1) ShareShare
ReportReport
Posted on by Microsoft Employee

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

Categories:
I have the same question (0)
  • Christopher S Profile Picture
    Microsoft Employee on at

    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!

  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    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!

  • baricuda Profile Picture
    2 on at

    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.

     

  • RobFisch Profile Picture
    8 on at

    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);

     

  • qwerty123456 Profile Picture
    6 on at
    Thanks for taking your time and posting this, it was very useful for me. Such an easy solution.
  • TheFreeMan Profile Picture
    48 on at

    I've used the accepted solution of relaunching the app without a parameter and it does work, but @RobFisch's suggestion seems much more elegant. However, I've tried it, but it's not working for me.

     

    In my App.OnStart, I've got :

    If(!IsBlank(Param("fvNumberParam")),Set(paramFvNumber,Param("fvNumberParam"));Set(deepLinked,true),Set(deepLinked,false))

    I use that to set a numeric filter value.

     

    Then in the RegionFilter.OnChange (I can filter on a number or a region - the link filters by number), I have this:

    UpdateContext({deepLinked:false})

     

    When I launch my app from a link with a parameter set, it seems that the code in the RegionFilter.OnChange is executing and I don't get my filtered view at all.

     

    Any thoughts on this?

  • TheFreeMan Profile Picture
    48 on at

    Found it!!

     

    Instead of using

    UpdateContext({deepLinked:false})

     

    I used:

    Set(deepLinked,false)

    And that made all the difference.

     

  • ryanbflorence Profile Picture
    13 on at

    This is not an elegant solution, but seems to work. Set a global variable to true once the parameter is used. Since the variable defaults to false when the app loads it will pass through initially. Later, we can test if the parameter was used and override or ignore the condition triggered by the parameter. Essentially, this creates a "throw-away" parameter that only acts one time on open of the app.

     

     

     

    If( And(!gbl_param_used, !IsBlank(Param("id"))),
    
    Set(varSelectedID, LookUp(datasource, guid = Param("id")).ID);
    Set(gbl_param_used, true);
    
    );

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard