cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TeresaRey
Frequent Visitor

Patch doesn't update selected record

I have a collection of Items shown in a gallery. When I click on details, a new screen opens up.

 

I want to be able to update the State of the Item when clicking a buton on the details screen,and to do that, I use the following function:


Patch(colOTOrders ; OT=GalleryTasks.Selected.OT ; {Status: 3})

 

Where OT is the ID of the Item.

 

For some reason, this doesnt work. Keep in mind that the details screen is not a form, so im not using "ThisItem" and I'm using the ID to find the record that I want to Update.

 

Any idea on how to work around this?

1 ACCEPTED SOLUTION

Accepted Solutions
dariobois
Resolver II
Resolver II

Hi!

is the gallerytasks linked directly to the de colOTOrders by the "items" gallery property? in that case you just use the patch function this way:

 

Patch(colOTOrders ; GalleryTasks.Selected; {Status: 3})

 

if not, try something like this:

 

Patch(colOTOrders ; First(Filter(colOTOrders; OT = GalleryTasks.Selected.OT)) ; {Status: 3})

 

Regards!

View solution in original post

3 REPLIES 3
dariobois
Resolver II
Resolver II

Hi!

is the gallerytasks linked directly to the de colOTOrders by the "items" gallery property? in that case you just use the patch function this way:

 

Patch(colOTOrders ; GalleryTasks.Selected; {Status: 3})

 

if not, try something like this:

 

Patch(colOTOrders ; First(Filter(colOTOrders; OT = GalleryTasks.Selected.OT)) ; {Status: 3})

 

Regards!

View solution in original post

It works! Thank you very much

TeresaRey
Frequent Visitor

I have also found out another way to do this correctly if the gallery is not directly linked to the colection:

Patch(colOTOrders ; {OT: GalleryTasks.Selected.OT} ; {Status: 3})

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Demo Extravaganza Winner Announcement

Please join us on Wednesday, July 21st at 8a PDT. We will be announcing the Winners of the Demo Extravaganza!

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (2,056)