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

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
firstImage

Microsoft Business Applications Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

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