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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Trying to PATCH for AL...
Power Apps
Answered

Trying to PATCH for ALLItems on Gallery Screen to Sharepoint List Column

(0) ShareShare
ReportReport
Posted on by 356

hi All,

 

Pls help..

 

I have a Screen that either

1) When Visible the Gallery Items PATCH a text label value to my SP List

2) Refreshes on a button would also PATCH that record 

 

Not sure how to go about it. Should i use a Collection ?

It seems to patch on EDIT but not all the time. I have a formula i am working with

ForAll(BrowseGallery1.AllItems,Patch('Vandalism and Insurance List',LookUp('Vandalism and Insurance List',ID=BrowseGallery1.Selected.ID),{'Number of Previous Incidents':Label2.Text}))

 

Where Label2 = 'Number Of Previous Incidents' , and the same Column Name in the SP List.

Lasherza_0-1662242968757.png

Not sure if Selected in above is correct, i merely would like to Patch that Number to my List which is a Single Line Text field.

Also not sure if i can use OnVisible of the Screen but should use a Button control instead..

 

Appreciate the help!

Categories:
I have the same question (0)
  • Verified answer
    WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @Lasherza ,

    Try this structure

    Patch(
     'Vandalism and Insurance List',
     ForAll(
     BrowseGallery1.AllItems As aPatch,
     {
     ID: aPatch.ID,
     'Number of Previous Incidents': aPatch.Label2.Text
     }
     )
    )

    you will also find it much faster than looping through Patch iterations (ForAll creates a Table)

     

    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.

    Visit my blog Practical Power Apps

  • Lasherza Profile Picture
    356 on at

    Wow @WarrenBelz  that's incredible!!. Never would have dreamt to use this formula...I have a lot lot to learn. Thank you so much!! It works as intended. 😀🙌

  • WarrenBelz Profile Picture
    153,084 Most Valuable Professional on at

    Hi @Lasherza ,

    You are not alone in using ForAll backwards (which still works mostly, but is very inefficient). What you are actually doing is creating a Table at the bottom with the ID and Incidents fields from the gallery and then sending the whole lot to SharePoint, which sorts it out - if it has a matching ID, it simply updates the relevant record in the Incidents field.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 739 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 343 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard