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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Check out the New Ideas Site

We are excited to announce a new way to share your ideas for Power Apps!

Top Solution Authors
Top Kudoed Authors
Users online (5,171)