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 / Update/Patch multiple ...
Power Apps
Answered

Update/Patch multiple fields in a gallery

(0) ShareShare
ReportReport
Posted on by 14

Hi all...

 

Not sure how to change multiple fields in a gallery. I'm confused about using patch vs updateif vs collect.

 

Basically...I have a dashboard page which displays appointments and details about each appt. I want the user to be able to hit the edit icon and be taken to a page where they can change these details if needed. Not sure how to make it happen. Any suggestions?

 

Untitled.pngUntitled1.png

Categories:
  • ThatAPIGuy Profile Picture
    925 on at

    @bucciface

     

    You could use Patch for this -

     

    Patch(Collection1, Filter(Collection1,Appointment=Dropdown1.Selected.Value&&Patient=Patient.Text),{Appointment:Dropdown1_1.Selected.Value,Patient:Name_1.Text,etc.})

     

    Also, I am curious to know what's your Datasource where you are saving all the data. If it's on a Sharepoint list, you can simply click on Create powerapp and it will automatically create the app with the view gallery, display a record/form and edit a record/ form and everything will be connected and linked.

     

  • bucciface Profile Picture
    14 on at

    I have the data on an excel sheet. If others will be using the app...is it best to have the data on a sharepoint list?

  • bucciface Profile Picture
    14 on at

    I have the data on an excel sheet. If others will be using the app...is it best to have the data on a sharepoint list?

  • ThatAPIGuy Profile Picture
    925 on at

    @bucciface

     

    If the data is in an excel sheet which is in OneDrive folder that is share with others, it should be fine as well.

     

    My personal preference would be a sharepoint list, as it has more customizing options compared to excel sheet.

     

    In both the cases, you can make the app automatically by following these steps -

     

    2018-02-16 22_25_42-PowerApps.png2018-02-16 22_26_45-PowerApps.png

     

    However, as you have some dropdown fields , I am not sure how that would work from excel. In Sharepoint List, you can define those as choice fields.

     

    Anyways, if you don't want to take this route,  let me know if the patch function worked for you.

  • leyburn19 Profile Picture
    2,157 on at

    I have found patch() and updateIF() unreliable for updaing records,  not sure if it me or the system.  You need to also not they are not deleagable (now up to 2000 records on client side)

     

    I use Flow to do this.  Very simply with sharepoint.  When it needs to be more than one record,  I embed the Flow in PowerApps in a Forall()

  • bucciface Profile Picture
    14 on at

    I wasn't able to get it working. I took a screenshot. The filter has invalid arguments. Screen Shot 2018-02-17 at 7.02.31 PM.png

     

    I must have something wrong in the filter argument. Thanks

  • leyburn19 Profile Picture
    2,157 on at

    Why are you trying to patch a collection.  Wouldn't it be simpler to have a Gallery that shows patients on the date (or between dates) then have a an edit form based on the Gallery.  When you select the patient it sends you to teh form,  which you edit and submit

     

    It also would be easier if you are doing this on a sharepoint list

  • ThatAPIGuy Profile Picture
    925 on at

    can you take a screenshot of the the error message?

  • bucciface Profile Picture
    14 on at

    Sure. Here it is. There may be more than just 1 error. 

    IMG_7611.jpg

  • Verified answer
    ThatAPIGuy Profile Picture
    925 on at

    @bucciface

     

    I see there was a mistake in my previous code. You need to patch to a record and the Filter statement produces a table instead of a record.

     

    so change it to

     

    Patch(Collection1, First(Filter(Collection1,Appointment=Dropdown1.Selected.Value&&Patient=Patient.Text)),{Appointmentropdown1_1.Selected.Value,Patient:Name_1.Text,etc.})

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 382 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 329

#3
WarrenBelz Profile Picture

WarrenBelz 187 Most Valuable Professional

Last 30 days Overall leaderboard