web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch gallery existing...
Power Apps
Answered

Patch gallery existing item creates new item

(0) ShareShare
ReportReport
Posted on by

Hi,

I've created a gallery with action buttons. The action buttons patch the items in the gallery.

 

Gallery items: EditArchitects_Icon_OnSelect_architectsAssigned_col- a collection of architects assigned to a case

Accept button - a button for an architect to accept assignment to the case.

Accept button code:

Patch(
 EditArchitects_Icon_OnSelect_architectsAssigned_col,
 ThisItem,
 {architectaccepted: 1}
);

 Before clicking accept:

1.PNG

After clicking on accept, a second empty item appears.:

2.PNG

When clicking the lead architect button on the empty item (code below):

Patch(
 EditArchitects_Icon_OnSelect_architectsAssigned_col,
 ThisItem,
 {
 leadarchitect: If(
 Self.Value,
 1,
 0
 )
 }
)

it changes the lead architect status of the first, valid item as well. So there's some connection between these two items.

 

Would you guys have any idea of how to stop the creation of the empty item?

Categories:
  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi @AterCZ,

    Could you please tell me why the accept button and decline button not appear in the new record since you have created a new one in your Gallery?

    Do you mean that your patch() formula creating a new record instead of updating the existing one?

     

    Based on your issue, I think it is weird. I suggest you reference to Gallery.Selected instead of ThisItem.

    Patch(
     EditArchitects_Icon_OnSelect_architectsAssigned_col,
     Gallery.Selected,
     {architectaccepted: 1}
    );

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 224 Super User 2026 Season 2

#2
WarrenBelz Profile Picture

WarrenBelz 189 Most Valuable Professional

#3
Mohsin Ali Profile Picture

Mohsin Ali 126

Last 30 days Overall leaderboard