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 Values (derived ...
Power Apps
Answered

Patch Values (derived from other values in gallery) into Local Collection

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hey everyone,

 

I'm encountering a challenge with my Power App and I could really use some assistance. Let me break it down for you:

 

In my edit form, I have a repeating gallery (see the attached picture for reference). The EAN_Combobox is a combo box with the following items property:

 

Sort(SKU_May23, EAN, SortOrder.Descending)

 

 

The data source SKU_May23 consists of the fields: EAN, SKU_ID, and Description. My goal is to set up the gallery fields "SKU ID" (LookUp_Gallery_SKU) and "Description" (LookUp_Gallery_Description) in a way that they display the corresponding SKU ID and Description when an EAN is selected from the Combobox.

 

Currently, I've set the following properties for the SKU field (Description is set up in the same manner):

 

OnChange: Patch(DataInput, ThisItem, {Collection_SKU_ID: LookUp_Gallery_SKU.Text})
Default: If(EditForm_Returns.Mode = FormMode.New, EAN_Combobox.Selected.SKU_ID)

 

These statements successfully display the SKU IDs and descriptions to the user, but they fail to store the text values into the collection. You can see the output of the collection in the attached picture.

 

As for the other fields in the gallery, I've set the Default property simply like this: "ThisItem.Collection_Qty." However, I'm unsure of how to combine this with the 'lookup' that needs to be set up for the SKU and Description values.

 

If anyone can provide some insights or solutions, I'd greatly appreciate your help!

Gallery editform - SKU Data 31072023.png
Output Collection - 31072023.png
Categories:
I have the same question (0)
  • Verified answer
    Community Power Platform Member Profile Picture
    Microsoft Employee on at

    This is now resolved. Using the OnChange property on the SKU and Description fields does not work since they show lookup values, derived from the EAN-field. The PowerApp does not consider the lookup values as a 'change' in those fields.

    To store the SKU and Description results, it needs to be added to the OnChange property of the EAN field as such:

     

    Patch(
    DataInput,
    ThisItem,
    {Collection_EAN: TextInput_Gallery_EAN.Text,
    Collection_SKU_ID: LookUp(SkuExpAug2023, EAN = TextInput_Gallery_EAN.Text, SKU_ID),
    Collection_Description: LookUp(SkuExpAug2023, EAN = TextInput_Gallery_EAN.Text, DESCRIPTION)}
    )

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 549 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 225 Super User 2026 Season 1

#3
Haque Profile Picture

Haque 224

Last 30 days Overall leaderboard