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 row depending on...
Power Apps
Answered

Patch row depending on prior combo box selections?

(0) ShareShare
ReportReport
Posted on by 503

Hey all,

 

I am trying to patch some data in the on select field of a button. This needs to be filtered on a prior combo box choice. 

 

So for example if customer 1 is selected in the combo box and oranges is selected in the next gallery, I need to log +1 clicks against - Oranges, Customer 1. (Screenshot attached for reference).

 

I managed to come up with this - 

Set(currentRecord, LookUp(Table7, ThisItem.Description=ThisRecord.Description));
 Patch(Table7, currentRecord, {CountOfClicks: currentRecord.CountOfClicks + 1})

But it only creates records for customer 1. 

Also I have sorted out how display the most clicked button at the top of the gallery in my prior post. But I just need to figure out what I explained above so I can log the clicks. Thanks everyone for the help. 

clicks.JPG
Categories:
I have the same question (0)
  • PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @Usernametwice23 ,

     

    As per your code Lookup will always returns one value that is why you are getting only one record in  currentRecord. If you try filter function to get all the records having selected description and Update the CountOfClicks column for those columns both customer 1 and customer 2 will get updated. 

     

    Let me know if need help with the code for this. 

     

     

  • Usernametwice Profile Picture
    503 on at

    Hi @PriyankaGeethik 

    Thank you for your suggestion. I have been trying to figure out the code but cant really come up with the correct filter. I have tried - 

    Patch(Table7, First(Filter(Table7, ThisItem.Description=ThisRecord.Description)), {CountOfClicks: ThisItem.CountOfClicks+1})

    It patches customer 1 selections perfectly but ignores the rest of the customers. 

     

    I've also tried -  (ignoring the first function)

    Patch(Table7, Filter(Table7, ThisItem.Description=ThisRecord.Description), {CountOfClicks: ThisItem.CountOfClicks+1})

    This gives me an error shown in the screenshot.

     

    Any ideas on how to write the correct syntax? 

     

    Thank you! 

     

    issue1.JPG
  • Verified answer
    PriyankaGeethik Profile Picture
    3,320 Super User 2024 Season 1 on at

    Hi @Usernametwice23,

     

    Would you mind trying below code. 

    UpdateIf(Table7,ThisItem.Description=ThisRecord.Description,{CountOfClicks: ThisItem.CountOfClicks+1} )

     

  • Usernametwice Profile Picture
    503 on at

    Perfect thanks so much! Looks like UpdateIf was what I needed 

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 206

Last 30 days Overall leaderboard