Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

Browse Gallery Selected Item as Dynamic Variable Update (Sharepoint list)



I try to use Variable instead of BrowseGallery.Selected but there is some problem with update the value after submit.


The Scenario:

The App is connected to Sharepoint list. To make it simple the App have 3 screens:

- on the first is Gallery from which you can choose Item

- second have View form of main data of selected item (also have some formulas which check if some of the fields are empty or not)

- third have full editable view of selected item


When I open the third screen and save the changes I made the application moving me to second page and here is the Issue.

When I'm using BrowseGallery.Selected everything working fine and fast but when I change to use Variable (which is safer for me especially when it coms to use some button to refresh sharepoint gallery, you know preventive action) then the Formula didn't see that I made some change on this item. It still remember the old/starting values.


I find out that when I add Set(varX, BrowseGallery.Selected) after submitting the form it almost working correct but not always. When I act fast select something and click Submit then it looks like the application suffers from a lack of time for all calculations. They are not visible in the Formulas but they are still in the cash memory (i know this because when I reenter to the third screen I see old data but when I submit form with out any change the second screen showing me the data I enter the first time, and then the loop is starting).

Dual Super User
Dual Super User

Before submitting the item save the ID from the variable.  Then submit the item. Then refresh the variable holding the item by doing a Lookup() based on the id.  Something like this.

set(vartempID, varX.ID);Submitform(formname);Set(varX, Lookup(datasource, ID = vartempID));

If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Helpful resources

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Top Solution Authors
Top Kudoed Authors
Users online (1,883)