cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ny8C
Frequent Visitor

Clear data from specific fields

Hi All,

I have a multiply screen app with hourly check (with Start/Hourly/Finish option). When the product finished I can reset all form (Button->OnSelect->ResetForm (Form1,) ResetForm (Form2)... etc). When I wish to continue the check then all data remain in the first form and disapear from rest of them as I need (first form removed from OnSelect ResetForm (Form2..etc) (Visibe option if start or hourly then continue check if finish then other button with new check label). Is it any chance that some data remain and some data reset in the first form?

Reset(Datacard1) doesnt work

Eg. When I submit the form then going back to Main screen and keep static info and clear that what need to change for new check.

I was tried ClearField option but only working this button on that screen where is the targeted form, and if there is no other formula, I tried from the Succes screen (from other screen) and did not work too.

Datacard1->default->ClearField

Submit->OnSelect->UpdateContext({ClearField:""})

Thanks for your help.

2 ACCEPTED SOLUTIONS

Accepted Solutions
Ny8C
Frequent Visitor

Hi @JR-BejeweledOne ,

 

Thanks for your quick respond.

 

I have already tried a similar option but did not help. After your answer I tried another way what is based on your comment and fortunately is working (quick note: the different characters in the formula depend on the language interface "," and ";"  and ";;"so you have to replace it with their english equivalents, by the way, PowerApps will remind you about the error during typing).

 

It is succesfully reset DropDowns and TextInput either, but keep the relevant datas for the next check.

It is working with Multiply screen, because the rest of the option was available on the current screen, but I reset the datas on a different screen.

 

See below the full command:

 

Screen ->> OnVisible

 

UpdateContext({ResetVar: true});;UpdateContext({ResetVar: false})

 

Selected DataCard/s (each) ->>Reset

 

ResetVar

 

Submit Button->>OnSelect

 

 UpdateContext({ResetVar: true});;UpdateContext({ResetVar: false})

 

Regards,

Ny8C

View solution in original post

Just remember that context variables only work on a single screen.   You are using context variables so they will only work on the screen you are setting them on. 

 

If you need to set them on one screen and have them work on another screen, you need to use global variables (i.e. Set(ResetVar, true)



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.

View solution in original post

4 REPLIES 4
JR-BejeweledOne
Super User
Super User

What you can do is check each DataCardValue for the data cards you want to reset and see if they have a reset property.  

 

Set a variable on visible of your screen.  Set(varReset, false).    Then use that in the reset property for the DataCardValue's that you want to reset in your first form.

 

In your button OnSelect, add this:  Set(varReset, true); Set(varReset, false).    You have to do both or those fields will not function correctly.



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
Ny8C
Frequent Visitor

Hi @JR-BejeweledOne ,

 

Thanks for your quick respond.

 

I have already tried a similar option but did not help. After your answer I tried another way what is based on your comment and fortunately is working (quick note: the different characters in the formula depend on the language interface "," and ";"  and ";;"so you have to replace it with their english equivalents, by the way, PowerApps will remind you about the error during typing).

 

It is succesfully reset DropDowns and TextInput either, but keep the relevant datas for the next check.

It is working with Multiply screen, because the rest of the option was available on the current screen, but I reset the datas on a different screen.

 

See below the full command:

 

Screen ->> OnVisible

 

UpdateContext({ResetVar: true});;UpdateContext({ResetVar: false})

 

Selected DataCard/s (each) ->>Reset

 

ResetVar

 

Submit Button->>OnSelect

 

 UpdateContext({ResetVar: true});;UpdateContext({ResetVar: false})

 

Regards,

Ny8C

Just remember that context variables only work on a single screen.   You are using context variables so they will only work on the screen you are setting them on. 

 

If you need to set them on one screen and have them work on another screen, you need to use global variables (i.e. Set(ResetVar, true)



If you like this post, give it a Thumbs up. If it answered your question, Mark it as a Solution to enable other users find it.
Ny8C
Frequent Visitor

Thats great,

At the moment I am using on only 1 screen as this is the purpose. But I will try this if I need that on other screen and will review this.

Thanks for tip.

Helpful resources

Announcements
Power Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (4,736)