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

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
Super User
Super User

Re: Update Gallery item using buttons

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

View solution in original post

3 REPLIES 3
Super User
Super User

Re: Update Gallery item using buttons

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

View solution in original post

Highlighted
sopatte
Level 8

Re: Update Gallery item using buttons

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

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

AlbertoSP
Level: Powered On

Re: Update Gallery item using buttons

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 156 members 5,536 guests
Please welcome our newest community members: