cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Anonymous
Not applicable

While using Variables it's showing values/results from previous record

I'm having a huge issue. I created a form using a number of variables to reference a field value which drives whether other fields are visible, required or the default value.
My problem is that when you submit or update an item/record, the variable does not clear and it shows in the new record.

For example, i have a button that if selected Set(varNotes "Ready"), then the default for datacardvalue1 is varNotes.

When i save and close this item and i go to the next item, the text in datacardvalue1 shows as "Ready" even thought i have not clicked the button yet. It's passing over the information and i dont want it to do that. Each item/record should be acting separately. Thank you!

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: While using Variables it's showing values/results from previous record

Hi @Anonymous ,

Based on the issue that you mentioned, I think this issue is related to that the varNotes is not cleared after you save your item or close the item.

 

On you side, when you save your item or close this item, you should also need to clear the varNotes variable at same time.

I have made a test on my side, please take a try with the following workaround:

Add the following formula within the OnSuccess property of the Edit form in your app:

Set(varNotes, Blank())          /* Clear this variable when you save your form */

Set the OnHidden property of your Edit screen (which contains Edit form) to following:

Set(varNotes, Blank())     /* <-- When navigating away from current Edit screen, the varNotes variable would be cleared */

Add the following formula within the OnSelect property of the "X" icon within your Edit screen:

Set(varNotes, Blank())          /* <-- Click "X" icon to close this item, then clear the varNotes variable */

Please take a try with above solution, check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

15 REPLIES 15
Highlighted
Dual Super User
Dual Super User

Re: While using Variables it's showing values/results from previous record

Hi @Anonymous 

 

Variables do not automatically clear as you move across screens

So every time you move/Navigate to next item make sure you reset the variable to empty

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Anonymous
Not applicable

Re: While using Variables it's showing values/results from previous record

I have tried that but it didnt work. Can you please share an example on where should i place the reset function?
Highlighted
Dual Super User
Dual Super User

Re: While using Variables it's showing values/results from previous record

Hi @Anonymous 

 

When you are Navigating to your item screen using the Nvaigate function

right before it

 

use Set(varNotes, "");Navigate....

 

Try this out

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Anonymous
Not applicable

Re: While using Variables it's showing values/results from previous record

Would the value still be saved to the field?
Meaning would the datacardvalue1.text = “Ready” in SharePoint?
Highlighted
Dual Super User
Dual Super User

Re: While using Variables it's showing values/results from previous record

Hi @Anonymous 

 

As long as you clear the value only when you show the new item form to the user

 

Please share some screenshots of your formulas and your App

 

Highlighted
Anonymous
Not applicable

Re: While using Variables it's showing values/results from previous record

Here is what is happening:

I have an add item button (plus sign) that sends the textinput value to the notes field (datacardvalue104) through the variable varNotes. This part is working fine; however, the varNotes variable needs to clear after the value (in this case "Text") is saved to the Notes field in sharepoint.

Highlighted
Dual Super User
Dual Super User

Re: While using Variables it's showing values/results from previous record

Hi @Anonymous 

 

The form that you are using to save data to sharepoint, you must be having a sumitform action

For this form control, there is an OnSuccess property which only runs when data is successfully posted to data source (in your case the SharePoint list)

 

In this property, you can clear the variable using Set(varNotes,"")

 

Regards,

Reza Dorrani

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Highlighted
Anonymous
Not applicable

Re: While using Variables it's showing values/results from previous record

Still not working, not sure what im doing wrong (see screenshot of OnSuccess)

Highlighted
Dual Super User
Dual Super User

Re: While using Variables it's showing values/results from previous record

Hi @Anonymous 

 

Ok and when are you setting the value for this variable to Ready?

Helpful resources

Announcements
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Users online (5,230)