cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
bucciface
Level: Powered On

Update/Patch multiple fields in a gallery

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

1 ACCEPTED SOLUTION

Accepted Solutions
Super User
Super User

Re: Update/Patch multiple fields in a gallery

@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.})


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

12 REPLIES 12
Super User
Super User

Re: Update/Patch multiple fields in a gallery

@bucciface

 

You could use Patch for this -

 

Patch(Collection1, Filter(Collection1,Appointment=Dropdown1.Selected.Value&&Patient=Patient.Text),{AppointmentSmiley Very Happyropdown1_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.

 


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bucciface
Level: Powered On

Re: Update/Patch multiple fields in a gallery

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
Level: Powered On

Re: Update/Patch multiple fields in a gallery

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?

Super User
Super User

Re: Update/Patch multiple fields in a gallery

@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.


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
leyburn19
Level 10

Re: Update/Patch multiple fields in a gallery

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
Level: Powered On

Re: Update/Patch multiple fields in a gallery

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
Level 10

Re: Update/Patch multiple fields in a gallery

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

Super User
Super User

Re: Update/Patch multiple fields in a gallery

can you take a screenshot of the the error message?


Vivek Bavishi aka That API Guy
PowerApps and Flow MVP
Blog | Twitter | YouTube | Community Profile | GitHub



If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

bucciface
Level: Powered On

Re: Update/Patch multiple fields in a gallery

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

IMG_7611.jpg