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 / Patch gallery item in ...
Power Apps
Answered

Patch gallery item in SP list

(0) ShareShare
ReportReport
Posted on by

Hello Expert!

 

I have an gallery from SharePoint list in PowerApps, In my gallery there is once dropdown (In SP list it's choice type column) one single line to text column, I want if user change any this from the dropdown then my collection should be updated and all the updated records of my collection should also be saved in my SharePoint list as well.

 

Kindly find below screenshot:

 

jay95_0-1662644495806.png

 On change property I am creating a collection as I highlighted in below Screenshot:

jay95_1-1662644586107.png

On select of Patch button I ma using below formula:

jay95_2-1662644656851.png

 

Can anyone help me??
@RandyHayes @WarrenBelz @BCBuizer @Drrickryp 

 

Categories:
I have the same question (0)
  • MVP-Phipps Profile Picture
    3,508 Super User 2024 Season 1 on at

    Patch should be like this:

    Patch(TableName, Record, {Values})

    You are not patching any values for example Title = TextInput1.Text

  • Verified answer
    RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    Your collection is only gathering the value of the dropdown.  This will not be sufficient for a Patch function.

     

    You don't need to put (duplicate) all the data from your gallery into a collection...the gallery already is a collection/table of the data you need.  It's just a waste of time to duplicate it and use OnChange actions, etc. to achieve what you need.

     

    Your Patch function would then be more like this:

    Patch(RMA_Order_Data,
     ForAll(yourGallery.AllItems,
     {ID: ID,
     yourDropdownColumnName: yourDropdownControlName.Selected
     }
     )
    )

     

    Now, the above is very basic as there are certain other elements of your app that need to be known in order to provide a more accurate formula.  But, the concept is the same.

     

    I hope this is helpful for you.

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @phipps0218 That is only ONE signature to the Patch function.  It allows for a variety of options and is not limited to just a record.

  • Community Power Platform Member Profile Picture
    on at

    Actually I want to capture all the modification in one collection then in one go I want to patch collection value in SP list. For example:
    In my gallery if there are 2 records and in every records there is one dropdown and one Text input fields and if user change the dropdown and and enter any text then first collection should be update and then If user click on button then patch function will executed. Is this possible?

  • Community Power Platform Member Profile Picture
    on at

    @RandyHayes 
    Actually I want to capture all the modification in one collection then in one go I want to patch collection value in SP list. For example:
    In my gallery if there are 2 records and in every records there is one dropdown and one Text input fields and if user change the dropdown and and enter any text then first collection should be update and then If user click on button then patch function will executed. Is this possible?

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    Yes, but again, there is no collection needed for it - it's just duplicating data and creating work for you to type in all the formulas.  The gallery has what you need!

    The only potential for a collection is to store the ID's of the records you want to patch.  But that has its drawbacks.

    Please take a look at this post (currently the last post in that thread) to get a pros/cons and how to achieve what you are looking for.

    I'd be happy to answer any questions you have on it.

  • Community Power Platform Member Profile Picture
    on at

    @RandyHayes 

    I guess if I directly use Patch in every item then it will impact on performance?

    And also where should I mention your formula in my app?

  • Community Power Platform Member Profile Picture
    on at

    @RandyHayes 
    I have used this but still my SP list is not updating.

    jay95_0-1662649583758.png

     

  • RandyHayes Profile Picture
    76,297 Super User 2024 Season 1 on at

    @Anonymous 

    Your formula is correct.  Noting that it would only be dealing with the CCStatus column in the formula.  If you want others, then you would want to add those into the formula.

     

    As for performance...it would be equivalent to a collection.  If you use the ForAll like a for loop, then it will kill performance (not that you are), if you use it like you have, then PowerApps will build the table of data to be given to the Patch prior to instantiating the Patch.  This is the same thing that you do (did) with the collection.

     

    The only thing you would want to do (beside adding more columns to your formula) is provide a way to determine what records to work with.  Using the .AllItems, will touch each record...edited or not.  

    If you look over that post that I last mentioned, I outline a couple options on how to account for ONLY changed records.

  • Community Power Platform Member Profile Picture
    on at

    Thanks @RandyHayes 
    It's working fine now!!

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 721 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 320 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard