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 / HELP with Patch in Gal...
Power Apps
Unanswered

HELP with Patch in Gallery

(0) ShareShare
ReportReport
Posted on by 37

I need to run a Patch on the OnChange function in a Gallery.

 

The column that needs patching will change depending on what item in the gallery is selected.

I have tried this formula, that seems logical to me, but does not seem to work:

 

Patch(Master_Data,LookUp(Master_Data,LO_ID = drpLearnObj.Selected.LO_ID),{ThisItem.Criteria_ID: txtScore_1.Text})

 

You'll see the part 'ThisItem.Criteria_ID:' - this is drawing from a separate data source and used to select the column to patch depending on the gallery item. The text of 'ThisItem.Criteria_1' matches the text of the column I'm trying to patch.

But it doesn't like it.

 

If I replace this with an individual column name ('Criteria_1:' for example), that patch works. But I only want this column patched on the first item in the gallery. The second item needs to patch Criteria_2 etc.

 

Any help is appreciated!

 

Andy

Categories:
  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @ARV84Z - when you select a Gallery item, the entire record is selected, not just a specific column.

     

    The Patch function requires a table, the relevant record you want to patch, and an explicit reference to the column or columns you want to update. You cannot dynamically select different columns.

     

    An alternative is to use the Switch function, but this could be unwieldy if you have more than a dozen columns you want to conditionally update.

     

    I would suggest using Power Automate to dynamically Patch different columns. 

  • ARV84Z Profile Picture
    37 on at

    OK, thank you @Amik for the reply.

     

    If I give you a little more description about what I'm trying to achieve, maybe you can suggest a better alternative:

     

    I have a database with 600 learning objectives, each of these learning objectives needs to be analysed using a 'training frequency calculator' (a 15 step process requiring user input to complete). I want the user to be able to select the learning objective from a list, then complete the calculator, and the score patched to the original database. 

    My design shows the calculator in a gallery to allow the user to scroll through the 15 steps (each step is a different item). I need the score of each step recorded, as well as the total score.

     

    If you can think of a better way to design this I'm all ears.

     

    Andy 

  • Ami K Profile Picture
    15,689 Super User 2024 Season 1 on at

    @ARV84Z - I am not good at visualising someone else's description of something in their heads.

     

    I would suggest forgetting Power Apps for a moment, and drawing a sample of your data in Excel together with the output you're expecting, and then paste them as images in your reply.

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 339 Super User 2026 Season 2

#2
M Bilal Khan Profile Picture

M Bilal Khan 289

#3
Mohsin Ali Profile Picture

Mohsin Ali 228

Last 30 days Overall leaderboard