cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
FernandB
Helper II
Helper II

ResetForm not working in datacardvalue with a variable as the default.

Hello,

 

The OnSelect of a button in my app Set(varM1P,varM1P+1) to count in a DatacardValue. The Default is varM1P. The forms do not reset at all after a submit.

 

 

FernandB_0-1618355536050.png

FernandB_1-1618355586498.png

 

OnSelect of Submit:


Set(
ChoiceVar,
{Value: "Open"}
);
Patch(
'Hand Hygiene Audit App',
varRecord,
Form1.Updates,
Form2.Updates,
Form3.Updates
);
ResetForm(Form1);
ResetForm(Form2);
ResetForm(Form3);
Navigate(
ScreenStart,
ScreenTransition.Fade
)

 

14 REPLIES 14

Hi Warren,

Yes. The variable resets now but when I go into the gallery to open the item it clears the data because the variable is still active. I have the same issue using UpdateContext.

Hi @FernandB ,

You seem to have a circular issue with your form and the variable - your original post was about resetting and seems to be solved. I cannot see your form, but have a look at the content and how it relates to the Variable.

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

FernandB
Helper II
Helper II

I used UpdateContext to update the variable for the OnVisible of the screen and this seems to have been the issue.
If(
varMode = "Edit",
UpdateContext(
{
varM1P: Value(varRecord.'Moment 1 Before patient or environment contact (Completed)'),

 

Thank you 

@FernandB ,

So this is not solved?

FernandB
Helper II
Helper II

Yes, after the initial issue of resetting the variable was resolved another issue came up where I couldn't save the records values.

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Power Apps Community Call Jan. 2022 768x460.png

Power Apps Community Call

Please join us on Wednesday, January 19th, at 8a PDT. Come and learn from our amazing speakers!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (2,064)