web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Gallery.Selected vs Se...
Power Apps
Answered

Gallery.Selected vs Set(var,ThisItem) updating query

(0) ShareShare
ReportReport
Posted on by 27

Hey Everyone,

 

I have built a power app for our service department at work. We service pumps and I am using Power Apps for our staff to input information into a SharePoint list as well as photos and Power Automate through various flows to create folders and put photos into the folders. Once the inspection is done, it runs a flow that populates a template using Adobe Document Generator API connection. It all works perfectly well apart from one thing.

 

I am sure most people on here has seen Shane Youngs videos. 6 months ago I did not know Power Apps existed and have since then been on a journey thanks to Shane's and a few other Youtube based resources. One video that caught my eye was that he recommended not to used Gallery.Selected anymore for various reasons. I did a bit more reading and people said it helped make the app more responsive, which it did. My app has about 350 columns in SharePoint over 3 lists, so does a lot of Patching as I patch every variable changed independently using the onchange function as it covers off every different type of pump we service. Quite a few are only used for their particular pumps types. However, the issue I am experiencing since changing everything to Set(var,ThisItem) is the lack of automatic updating, which makes sense. You need to go back out to update the variable. I have worked around some bits, especially for visibility functions by getting it to reference the component and patching so it avoids issues with the need to update to make items visible and it will automatically do it when you reopen it anyway. Other than adding Set(var,ThisItem) after every patch, is there anything else I can do?

 

Kind Regards,

Sam

Categories:
  • WarrenBelz Profile Picture
    156,736 Most Valuable Professional on at

    Hi @slogan ,

    Yes - two things - the Item of the Form can be

    LookUp(
     SPList,
     ID = var.ID
    )

    and OnSuccess of your Form

    Set(
     var,
     Self.LastSubmit
    )

    and the Form (in any mode) will update automatically and assuming your Gallery is based directly on the SP List, it will also.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

    MVP (Business Applications)   Visit my blog Practical Power Apps

     

  • slogan Profile Picture
    27 on at

    Hi @WarrenBelz 

     

    Thank you for your response. Sorry I have been tied up on other projects and only am just managing to get back to this one. What about if you are not using a form? I have way too many variables to be using forms I feel so everything uses patch.

     

    Kind Regards,

    Sam Logan

  • WarrenBelz Profile Picture
    156,736 Most Valuable Professional on at

    Hi @slogan ,

    Possible, but a big and complex job if you do not use a Form

  • Verified answer
    slogan Profile Picture
    27 on at

    Hi @WarrenBelz ,

     

    Sorry I have been working on other projects and have just got back to this. I have managed to sort this using Set(varRecord,Patch........). It works a treat. The form thing really won't work that well for me as my SP list is 356 column long that are not always used. 

     

    Thanks for your help.

     

    Kind Regards,

    Sam

  • WarrenBelz Profile Picture
    156,736 Most Valuable Professional on at

    Hi @slogan ,

    This is now closed ?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 354 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 320

#3
Mohsin Ali Profile Picture

Mohsin Ali 246

Last 30 days Overall leaderboard