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

update multiple records from a gallery to a SharePoint list

Hello everyone,

I currently have a Sharepoint list titled "test" that is connected as the datasource for a gallery in my PowerApp. Within my gallery, I have the name on the left, with an empty text_input (titled reason) next to it that it empty for all the records (this corresponds with a column titled reason in the SharePoint). I want to the user to be able to go in and change the reason for any/all of these gallery items, and have a button patch over this column to update the records. So in short, is there any way for me to update a single column of these selected records?

 

The code I am currently using is:

Patch('test', Gallery2.Selected,{Reason:Reasoning.Text})

 

This issue with this is that it is only updating the selected value in the gallery, but I am not able to have all values in the Gallery update simultaneously. Any help would be very beneficial. 

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @user77 ,

 

Do you want to update all items in the gallery to its data source?

 

If you do, you could use the ForAll and Patch functions, but for the reason that it is necessary to find the proper record to update you will need to add a Lable in the gallery items to hold the ID of the record. Below is a demonstration:

 

8.png

patch_all.gif

9.png

And the formula is:

ForAll(Gallery.AllItems,Patch(DataSource,LookUp(DataSource,ID = Value(IDLabel.Text)), {Reason:ReasonInput.Text}))

 You could set the Visible of IDLabel to false to hide them in the gallery.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

2 REPLIES 2
New Member

That being said, I am able to have a button in every record for the gallery, but I would like the user to have a single button to select, which can update all of the records at once. 

 

Hi @user77 ,

 

Do you want to update all items in the gallery to its data source?

 

If you do, you could use the ForAll and Patch functions, but for the reason that it is necessary to find the proper record to update you will need to add a Lable in the gallery items to hold the ID of the record. Below is a demonstration:

 

8.png

patch_all.gif

9.png

And the formula is:

ForAll(Gallery.AllItems,Patch(DataSource,LookUp(DataSource,ID = Value(IDLabel.Text)), {Reason:ReasonInput.Text}))

 You could set the Visible of IDLabel to false to hide them in the gallery.

 

Hope this helps.

 

Best regards,

Community Support Team _ Jeffer Ni
If this post helps, then please consider Accept it as the solution to help the other members find it.

View solution in original post

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (3,720)