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
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
Highlighted
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
Resolver II
Resolver II

Re: Update Gallery item using buttons

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

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

Highlighted
Helper II
Helper II

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
secondImage

New Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Check this Out

Helpful information

Featuring samples like Return to the Workplace and Emergency Response Applications

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

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