cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
golfnutt82
Super User
Super User

Saving a SharePoint List Item after Edit on Gallery Form

Hello Power Apps Professionals,
This board has been extremely helpful in helping me solve the issues I bumped up against!
My news situation is that I have a Power App Gallery Form that has some filtering, and I can choose a record to edit but that is where it stops. I need to be able to not only edit the record but save it.
It's hard to believe this is that complicated to solve.
Any direction is appreciated.
Putting a button on the item as shown, which puts buttons on all subsequent items below is what I am looking for but I cant figure out the logic that would go in the OnSelect property for the Save Button. 

golfnutt82_0-1642616210886.png

For some reason the "New Role Owner" doesnt act like a person/group field and recognize a person.
Also, for the Items property I have some logic in there for the search and filtering.

golfnutt82_0-1642616554783.png

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Pstork1
Dual Super User
Dual Super User

Lets try to handle the problems one at a time.  First for saving.  The OnSelect of the button would be a Patch() statement something like this.  In the record that is the third parameter you'll need to supply the fieldnames: values for each field you want to save.  You also must include values for any required fields, like Title

patch(datasourcename, thisitem, {Title: thisitem.Title, otherfield: otherfieldvalue, ...})

For the other problem can you explain what kind of SharePoint column the roleowner is?

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

View solution in original post

4 REPLIES 4
Pstork1
Dual Super User
Dual Super User

Lets try to handle the problems one at a time.  First for saving.  The OnSelect of the button would be a Patch() statement something like this.  In the record that is the third parameter you'll need to supply the fieldnames: values for each field you want to save.  You also must include values for any required fields, like Title

patch(datasourcename, thisitem, {Title: thisitem.Title, otherfield: otherfieldvalue, ...})

For the other problem can you explain what kind of SharePoint column the roleowner is?

 



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Hi and thank you for responding.
The only editable field is the New Role Owner field, which is a PersonGroup field where I can enter in the last name of the user, and it shows a list of users.

Person/Group fields need to be patched in a particular record format.  Here's a post that shows the format required for patching a person/group field.

PATCH A SharePoint Person Column In Power Apps - Matthew Devaney

 

Whether the other fields are represented in the Gallery or not. A Patch must always include values for all the required fields.  By default this would just be the title field. If any other fields in SharePoint have been marked as required they will need to be included in the Patch.



-------------------------------------------------------------------------
If I have answered your question, please mark your post as Solved.
If you like my response, please give it a Thumbs Up.

Excellent! Thanks for your assistance

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (2,158)