cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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.
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.
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

Watch Sessions On Demand!

Continue your learning in our online communities.

SecondImage

PowerApps Monthly Community Call

Next Wednesday, September 18th at 8am PDT

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

FirstImage

Power Platform World Tour

Coming to a city near you

thirdimage

PowerApps Community User Group Member Badge

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

FourthImage

Join PowerApps User Group!!

Connect, share, and learn with your peers year-round

SecondImage

Power Platform Summit North America

Register by September 5 to save $200

Top Kudoed Authors
Users Online
Currently online: 4 members 3,097 guests
Please welcome our newest community members: