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!
Solved! Go to Solution.
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,
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
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
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
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.
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
Hi @Anonymous
Ok and when are you setting the value for this variable to Ready?
Check out new user group experience and if you are a leader please create your group
Did you miss the call?? Check out the Power Apps Community Call here!
See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.
User | Count |
---|---|
256 | |
254 | |
83 | |
40 | |
30 |
User | Count |
---|---|
311 | |
265 | |
122 | |
65 | |
48 |