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.
Solved! Go to Solution.
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:
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.
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:
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.
Stay up tp date on the latest blogs and activities in the community News & Announcements.
Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST
Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.
User | Count |
---|---|
200 | |
183 | |
76 | |
46 | |
37 |
User | Count |
---|---|
325 | |
258 | |
123 | |
72 | |
58 |