cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
OiBigRed
New Member

Refresh variables when SubmitForm

Hi Guys, 

Complete noob to the powerapps stuff but our usual guy is busy with other projects at the moment so Im taking some stuff over.

Currently have an inventory app with a gallery,

I then call all the variables as so, when pressing the arrow on the gallery

Set(varShelf, "Shelf : " & ThisItem.Shelf & ThisItem.Level)
&
Set(varLevel, ThisItem.Level)
&
Set(varPart, ThisItem.Part)
&
Set(varNotes, "Notes : " & ThisItem.Notes)
&
Refresh('Production Stock')

I then have on the second half of the splitscreen, all of these variables called to make a expanded info kind of section

we often add notes to these inventory items so I have added an "edit notes" button

Production Inventory App.png

OiBigRed_0-1660768173248.png

 

When I hit the plus, it runs this 

 

SubmitForm(EditNoteForm) & Refresh('Production Stock') & Set(popup, false)

 

However, it doesnt refresh the "varNotes" variable. 
When I put "Refresh(varNotes)" it errors,
Or
When I put "Set(varNotes, 'NoteEdit')"

Im hoping someone has a way I can refresh the variable so it updates my "varNotes" live?

Willing to answer questions

Thanks
Ryan

 

2 ACCEPTED SOLUTIONS

Accepted Solutions
StretchFredrik
Super User
Super User

Do you want to send this data somewhere or just set the variable?

 

If you just want to set the value in the variable try 

Set(Test,TextInput1.Text)

View solution in original post

Amazing!

Was just missing that .text off the end, now it works 🙂

its simply to set the value as Ive already called it in a TextLabel


Thank you so much

Kind regards
Ryan

View solution in original post

9 REPLIES 9
StretchFredrik
Super User
Super User

Hello @OiBigRed ,

 

What does the error message say?

 

 

OiBigRed_0-1660768851254.png

This is the error, I see the how to fix, I havent used a context variable or set a type, nor know how to yet

Kind regards
Ryan

StretchFredrik
Super User
Super User

The variable VarNotes probably have a value somewhere in the app, the new value has to be of the same "Kind" so if it was previously text, the updated version also needs to be text. 

OiBigRed_0-1660769132760.png

This is where the variable is created, pulled from the gallery and turned into a variable

Just trying to edit the variable unless theres a way of calling the gallery value "ThisItem.Notes" and replacing it with the edited note?
Ive no clue clearly

Kind regards
Ryan

StretchFredrik
Super User
Super User

Alright so it appears to be a text variable, and what is the value you are trying to update it with? Is it the value of the textbox?

Yeah exactly that, just update it with whats inputted into the textbox

StretchFredrik
Super User
Super User

Do you want to send this data somewhere or just set the variable?

 

If you just want to set the value in the variable try 

Set(Test,TextInput1.Text)

Amazing!

Was just missing that .text off the end, now it works 🙂

its simply to set the value as Ive already called it in a TextLabel


Thank you so much

Kind regards
Ryan

StretchFredrik
Super User
Super User

Glad I could help.

 

If this solved your issue please mark your post as solved. 
Also, if you appreciated my answer, dont forget to thumb it up 😃

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

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