cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
D_Whitfield
Level: Powered On

Reset or Set Param() to empty / NULL / blank

I have used a parameter in line with a Microsoft Flow to provide a URL to an item in the app gallery.


This works all fine thanks to the awesome tutorials through this forum.


Is there any expression / method to clear the parameter or reset the parameter. As it seems to keep the parameter set after entering the app with one link.

 

That seems to store it and when you use another link it fails to go to the correct record, but goes back to the original parameter record.

 

Anyone in a similar situation any help appreciated 

9 REPLIES 9
Community Support Team
Community Support Team

Re: Reset or Set Param() to empty / NULL / blank

Hi @D_Whitfield,

 

I can not get how your flow and app configured and would you please describe in detail about this? Did you start a flow in PowerApps or what? What is the parameter you referred to? What is the data source in app and configuration in flow?

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
D_Whitfield
Level: Powered On

Re: Reset or Set Param() to empty / NULL / blank

So basis is we have a ticket system with the data source being a Sharepoint List.

 

I have a flow which updates Teams or by Email depending on what is selected , letting know that the person involved something has changed.

 

I pass the app link + ID of the sharepoint item, which is picked up when App starts to check if parameter has a value.

Like this useful tutorial from these forums : 

https://powerapps.microsoft.com/en-us/blog/powerapps-deep-linking/

 

This is all good works, however say i want to go home after opening a link from the flow where it is setting the parameter. Any navigation to home or whatever goes back to the original parameter ticket becase the param() is set and not NULL.

 

hope this sheds some light on the scenario.

 

Any help appreciated 

 

D

JeffWhite
Level: Powered On

Re: Reset or Set Param() to empty / NULL / blank

@D_Whitfield

 

I just ran into exactly this concern after reading that awesome "deep linking" blog. I don't know if this is the best way, but it worked for me.

 

I modified my "Home" icon and the Timer's Autostart statement. So the Parameter will remain in the URL...but the variable for TimerStop doesn't let the autostart engage. I don't like that parameter floating around there....but I'm not adept enough with PowerApps to figure out how to remove it! 

 

What I did--

 

On Detail page (would be necessary on ALL home icons):  OnSelect -->   Navigate(Home,None,{TimerStop:"Y"})

 

And set the Timer control:   AutoStart-->  IF(TimerStop="Y", false, true)

 

 

-Jeff

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Reset or Set Param() to empty / NULL / blank

Since that blog post was written, there is a new property that was added to PowerApps: OnStart. That property represents an action that is run only when the app is launched, and you can find it on the first screen of the app.

 

So if you move your logic deep linking logic from the home screen's OnVisible property to the OnStart property, then it will not be executed after you move from one of the other screens back to the Home screen.

 

If I understand correctly, this should work for your scenario of page navigation. As for the exact question that you asked: Param() cannot be reset - it reflects the parameters that were passed to the app when it was opened. However, you can also use the OnStart property to make this scenario work - in the OnStart action you can set a variable (say, 'currentParam') with the parameter that was passed, and later when you want to clear it, you can set it again to Blank().

 

Dawidvh
Level 10

Re: Reset or Set Param() to empty / NULL / blank

I agree the onstart is be better for email links.

Another thing to keep in mind is that you can set a variable with the value of the parameter, and then manipulate the variable as you want. You can then easily blank the variable with Set(varname,Blank())

 
Beat
Level 8

Re: Reset or Set Param() to empty / NULL / blank

I have the same problem, after passing the ID of an item as parameter in the URL. The Param("ID") will retain it's value. While I can set variable, blank() or {context: blank()}), I can't manage to set Param("ID") to blank. How can this be done?

PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Reset or Set Param() to empty / NULL / blank

Param("ID") will always return the value of the parameter "ID" that was passed when the app was opened - you cannot set it to a different value unless you reopen the app with a different parameter. What you can do is to save that value in a variable in the OnStart action of the app, then update that variable as needed.

Beat
Level 8

Re: Reset or Set Param() to empty / NULL / blank

Ok, makes kind of sense. I realized this actually has a nice side-effect. If you open the DetailForm via deeplinking but then navigate away from that screen, you can easily return to the starting point by refreshing the browser tab. That's quite useful if you for example want to review some other records before updating the targeted one. Instead of searching for it again, just press F5.

Highlighted
AmyRock
Level: Powered On

Re: Reset or Set Param() to empty / NULL / blank

Thank you for this @CarlosFigueira , finally explained in a way I can understand.  Just implemented and works like a charm!!

Helpful resources

Announcements
firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Users Online
Currently online: 52 members 4,348 guests
Please welcome our newest community members: