cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper I
Helper I

Variables not reset in new form

Good afternoon friends,

I need help. I am creating an application and I need to save the current date and time in a box, and save the form. When I send a new form the fields with variables are not deleted, they are always there, and I put resetform in the button code. Attached is the print of the button code. The variable is in DataCardValue22 (print2)

thank you

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: Variables not reset in new form

Hi @straiderox2 :

Do you wish to implement the following functions:

  • DatacardValue22 is always empty when the user does not press the button
  • When the user presses the button, DatacardValue22 is the current time, and then submit the form
  • DatacardValue22 is empty after table reset

Please try this code:

 

Set(varPaus,Now());
SubmitForm(FormNew);
ResetForm(FormNew);
Set(varPaus,Blank())

 

In addition, if varPaus is referenced in multiple places, I suggest you create another variable specifically for DatacardValue22.

 Best Regards,
Bof

View solution in original post

7 REPLIES 7
Highlighted
Super User III
Super User III

Re: Variables not reset in new form

Hi @straiderox2 ,

What is the Default of this field - I see you are setting varPausa to Now() - is this going into the field?

 

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.

Highlighted
Helper I
Helper I

Re: Variables not reset in new form

Hello @WarrenBelz .

 

The default I put in this field is varPausa. I put on the Pausa button that this variable should call the Now () command.

Highlighted
Super User III
Super User III

Re: Variables not reset in new form

@straiderox2 ,

Then that is your problem - you have set varPausa to Now() and set the default of the control to varPausa, so it has to show the current date and time and is doing exactly what you have told it to do.

 

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.

 

 

Highlighted
Community Support
Community Support

Re: Variables not reset in new form

Hi @straiderox2 :

As @WarrenBelz  said, since you have set the Default property of DataCardValue22 to varPaus, then after reset, the control will inevitably display the value of varPaus.

Could you tell me:
When do you want DataCardValue22 to be empty?
If you want to reset DataCardValue22 to null after the user submits, when is DataCardValue22 the default value?

Best Regards,

Bof

Highlighted
Helper I
Helper I

Re: Variables not reset in new form

Hello @v-bofeng-msft.

Answering your questions

 

When do you want DataCardValue22 to be empty? When I make a new form.

 

If you want to reset DataCardValue22 to null after the user submits, when is DataCardValue22 the default value? What I need is that when the user clicks the button the field is filled with the current date and time. I want to know the time the user started the form (this I already solved) and the time it ended and saved. So with each new form I need the DatacardValue22 to be blank, waiting to save and fill in the current date and time.

 

Thankss

 

Highlighted
Community Support
Community Support

Re: Variables not reset in new form

Hi @straiderox2 :

Do you wish to implement the following functions:

  • DatacardValue22 is always empty when the user does not press the button
  • When the user presses the button, DatacardValue22 is the current time, and then submit the form
  • DatacardValue22 is empty after table reset

Please try this code:

 

Set(varPaus,Now());
SubmitForm(FormNew);
ResetForm(FormNew);
Set(varPaus,Blank())

 

In addition, if varPaus is referenced in multiple places, I suggest you create another variable specifically for DatacardValue22.

 Best Regards,
Bof

View solution in original post

Highlighted
Helper I
Helper I

Re: Variables not reset in new form

Thankss @v-bofeng-msft worked 🙂

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (5,899)