cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
avicadolui
Level: Powered On

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

the Ready was just an example. What im really doing is sending the text from textinput1 to the notes field with the Plus icon (screenshot). I'm also including the screenshot of the Onvisible from the form so you can see how im updating the notes field when opening a record.

cwebb365
Level 10

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

Looks like your overwriting notes. Is that what you want or are you appending?

If appending you’ll want to load the note from data source into variable on visible. Then when you do your update context you want to do varnotes: varnotes & textbox.text) so it appends. You can add a carriage return in there too with something like varnotes & “ shift+enter “ & textbox.text)

Then submit form should submit that over. If your screen navigates to your selection every time then the onvisable variable should be all you need.
cwebb365
Level 10

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

If that doesn’t help any might be a selection issue not updating it right. Move the variable set from onvisable over to your gallery? Onselect. Plug in before navigate your update context statement followed by ; but instead of selected. Use updatecontext({varnotes:ThisItem.Notes})

Pretty sure you can access that via onselect.
Community Support Team
Community Support Team

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

Hi @avicadolui ,

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

dev_fridden
Level: Powered On

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

It looks like you are mixing Set(varNotes...) with UpdateContext({varNotes:})

 

The UpdateContext() will create a scoped variabled for that screen. It will overshadow the global variable you created with Set(). Thus when you are resetting the varNotes using Set() it will not reset the context variable.

 

Hope this helps

Fredrik

avicadolui
Level: Powered On

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

Yes i went back and changed all of the variables to Set() and moved the variable from the OnVisible to Sharepointintegration in the New, Edit & VIew properties. It works now. However, i have not cleared the variables since the sharepointingration overwrites the value each time i open a new record.

Helpful resources

Announcements
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,118)