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
Ignite 2022

WHAT’S NEXT AT MICROSOFT IGNITE 2022

Explore the latest innovations, learn from product experts and partners, level up your skillset, and create connections from around the world.

Power Apps Africa Challenge 2022

Power Apps Africa Challenge

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

Top Kudoed Authors
Users online (3,393)