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
PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,595)