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 function in a ga...
Power Apps
Unanswered

Patch function in a gallery patches combobox from different row to item in selected row

(0) ShareShare
ReportReport
Posted on by 10

Hi folks,

 

i have an issue with one of my apps and i can't find a solution.

I'm using a gallery to display items from a SharePoint list.

My gallery allows the user with text input and combo boxes to change different entries on the list and a save button to change the changes of the item in the row.

I have this in several apps but one makes me headaches.

In this app the patch on the save button seam to glich around, when change one combo box in one row to one item and excellently click the save button in a different row to a different item the item in the row where the save button was clicked gets the value from the row where something was changed.

As said I have the same functionality in multiple other apps where the same behaviour can't be reproduced.
I've check the item source for the gallery, didn't change something.

I've recreated the combo boxes, didn't change something.

I've added Select(Parent) before patch().

I've changed ThisItem to lookup with ID, didn't change something.

 

Dose anyone maybe knows how this can happen?
Do you need some more details? Below my patch function


This is my patch:

Patch(
source1,
ThisItem,
{
Title: ti_main_list_SalesOrder.Text & "," & If(
IsBlank(First(cb_main_list_Customer.SelectedItems).CustomerName),
LookUp(
source2,
ID = ThisItem.CUSTOMER_ID,
CustomerName
),
First(cb_main_list_Customer.SelectedItems).CustomerName
),
SALES_ORDER: ti_main_list_SalesOrder.Text,
CUSTOMER_ID: If(
IsBlank(First(cb_main_list_Customer.SelectedItems).ID),
ThisItem.CUSTOMER_ID,
First(cb_main_list_Customer.SelectedItems).ID
),
C_M_ID: If(
IsBlank(First(cb_main_list_CM.SelectedItems).ID),
ThisItem.C_M_ID,
First(cb_main_list_CM.SelectedItems).ID
),
UKN_NUMBER: ti_main_list_UKNNumber.Text,
JOB_TYPE_ID: If(
IsBlank(First(cb_main_list_JobType.SelectedItems).ID),
ThisItem.JOB_TYPE_ID,
First(cb_main_list_JobType.SelectedItems).ID
),
TASK_TYPE_ID: If(
IsBlank(First(cb_main_list_TaskType.SelectedItems).ID),
ThisItem.JOB_TYPE_ID,
First(cb_main_list_TaskType.SelectedItems).ID
)
}
)

Categories:
I have the same question (0)
  • M_Ali_SZ365 Profile Picture
    1,110 on at

    Hi @Locao 

    Try This 

    // This is called when the selection of the combo box changes
    OnChange of ComboBox:
    UpdateContext({selectedCustomer: ComboBox.Selected})

    For Patch

    // This is called when the save button is clicked
    OnSelect of SaveButton:
    Patch(
     source1,
     ThisItem,
     {
     Title: ti_main_list_SalesOrder.Text & "," & selectedCustomer.CustomerName,
     ...
     // other fields to patch
     }
    )

    Please accept this solution if it resolves the issue.
    Best regards,
    Muhammad Ali

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

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 379 Most Valuable Professional

#2
11manish Profile Picture

11manish 203 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 128 Super User 2026 Season 2

Last 30 days Overall leaderboard