cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper II
Helper II

Update Gallery item using buttons

Hi,

I have Gallery (GallaryReq) that shows pending vacation requests.
How would I go about updating an item using he "Cancel Request" button.
If click on the button next to Item 190,  the Status field in the sharePoint list 'Absence Requests' data connection, will get update  to "Cancelled"
I
Capture.PNG

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Super User III
Super User III

@AlbertoSP 

On your OnSelect you can use a formula like this:

Patch('Absence Requests, ThisItem, {status:"Cancelled"})

There are some caveats here...this assumes you are not doing anything in particular with the Items of the Gallery (addcolumns, removecolumns, etc)

Also, not knowing what kind of column your Status column is (the above assumes text).

If it is a Choice column, then you will need to alter to this formula:

Patch('Absence Requests, ThisItem, 
{status:
{Value:"Cancelled",
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}
}
)

I hope that is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

3 REPLIES 3
Highlighted
Super User III
Super User III

@AlbertoSP 

On your OnSelect you can use a formula like this:

Patch('Absence Requests, ThisItem, {status:"Cancelled"})

There are some caveats here...this assumes you are not doing anything in particular with the Items of the Gallery (addcolumns, removecolumns, etc)

Also, not knowing what kind of column your Status column is (the above assumes text).

If it is a Choice column, then you will need to alter to this formula:

Patch('Absence Requests, ThisItem, 
{status:
{Value:"Cancelled",
'@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
}
}
)

I hope that is helpful for you.

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up. Solved your problem? - Click on Accept as Solution. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too!

View solution in original post

Highlighted
Microsoft
Microsoft

I have a  button in a gallery with the following OnSelect:

Patch(MySharepointDatasource,ThisItem,{NameOfField: SomeValue})

Highlighted

Its text field and worked!!
Thank you very much. It was simpler then what I tried

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Community Highlights

Community Highlights

Check out the Power Platform Community Highlights

Top Solution Authors
Top Kudoed Authors
Users online (10,384)