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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (3,258)