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 / update selected galler...
Power Apps
Answered

update selected gallery data in PowerApps using patch

(0) ShareShare
ReportReport
Posted on by 62

I have Gallery data and I want to update Gallery data in forms. I use Lookup to select a specific record and update corresponding columns. However, it's not working with this code. I check questions in this forum but it's not working.

Patch('My sharepoint List', Lookup('Employee name'=BrowseGallery1.Selected.'Employee Name'),
{Wage: Value(Value(Datacardvaluework.Value) * Piecerate.Selected.'Piece Rate')},
{'E. ID': Dropdown2_1.Selected.'Employee ID'},
{'Employee Name': ComboboxCanvas1.Selected.Value},
{'Cost Category':DataCardValue3.Text},
);

I tried updateIf its not working too. 

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

    Hello 

    The error occurs cos PowerApps is confused with the Lookup Values, might sound funny but its been around for awhile 

    made a post recently fixing it 

    https://medium.com/@olumideojoniyi/updating-multiple-records-in-a-gallery-or-collection-with-unique-values-90da5a086878  
    Revert if issue is not solved 

  • Rajkumar_M Profile Picture
    3,747 Moderator on at

    Hi @Gizachew 

    The issue with your Patch function is that the Lookup function is not being used correctly. The Lookup function should be used to find the record in the SharePoint list that matches the selected employee name, and then the Patch function should be used to update the corresponding columns.

     

    Patch( 'My sharepoint List', 
    Lookup(
    'My sharepoint List',

    'Employee name' = BrowseGallery1.Selected.'Employee Name'
    ),

    {
    Wage: Value(Value(Datacardvaluework.Value) * Piecerate.Selected.'Piece Rate'),

    'E. ID': Dropdown2_1.Selected.'Employee ID',

    'Employee Name': ComboboxCanvas1.Selected.Value,

    'Cost Category': DataCardValue3.Text
    }
    )
     
    Thanks!
     
    If my response has been helpful in resolving your issue, I kindly request that you consider clicking "Accept as solution" and "giving it a thumbs up" as a token of appreciation.
  • Gizachew Profile Picture
    62 on at

    I rewrite the lookup code correctly like below but it's not working.

    Patch( 'My sharepoint List', 
    Lookup(
    'My sharepoint List',

    'Employee name' = BrowseGallery1.Selected.'Employee Name'
    ),

    {
    Wage: Value(Value(Datacardvaluework.Value) * Piecerate.Selected.'Piece Rate'),

    'E. ID': Dropdown2_1.Selected.'Employee ID',

    'Employee Name': ComboboxCanvas1.Selected.Value,

    'Cost Category': DataCardValue3.Text
    }
    )
  • Verified answer
    Gizachew Profile Picture
    62 on at
    Patch( 'My sharepoint List', 
    Lookup(
    'My sharepoint List',

    ID = BrowseGallery1.Selected.ID
    ),

    {
    Wage: Value(Value(Datacardvaluework.Value) * Piecerate.Selected.'Piece Rate'),

    'E. ID': Dropdown2_1.Selected.'Employee ID',
    }
    )
    I changed to column ID in lookup so that I can be able to update selected field.

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the April Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Vish WR Profile Picture

Vish WR 414

#2
Valantis Profile Picture

Valantis 408

#3
timl Profile Picture

timl 339 Super User 2026 Season 1

Last 30 days Overall leaderboard