cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Community Support Team
Community Support Team

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

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?
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

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?
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

 

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

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)

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
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,391)