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 data with Patch...
Power Apps
Answered

Update data with Patch and Lookup

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi everyone,

 

This is very basic, but I'd like to ask how can I update the form data by using Patch and Lookup. Here's my code for inserting the data with a Patch function.  I'm an absolute beginner please bear with me. Thank you.

 

Patch(
 Table_SiteTimesheet,
 Defaults(Table_SiteTimesheet),
 {
 Work_Date: Value(Date_WorkDate_1.SelectedDate),
 Name_Project: DD_NameProject_1.Selected.Name_Project,
 Code_Project: DD_NameProject_1.Selected.Code_Project,
 Note: Text_Note_1.Text,
 Start: DD_StartTime_1.Selected.Value,
 End: DD_EndTime_1.Selected.Value,
 User_Name: User().Email, 
 ModifiedOn_Date: Today()
 }
);
Categories:
I have the same question (0)
  • myke_deabreu Profile Picture
    220 on at

    Hi imaliasad,

     

    What are you trying to lookup? 

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Hi @myke_deabreu thank you for replying again. 

     

    I have a column name ID_Timesheet, which I'd like to use with Lookup to update the record of that row. can I do that with Patch and Lookup, if yes would appreciate if you explain it to me

  • Verified answer
    myke_deabreu Profile Picture
    220 on at

    I think I understand what you asking.

     

    First assign the ID you want to update to a varible (e.g. Set(varname, the id you updating) 

     

    Then you could do something like this:

     

    Patch(
    Table_SiteTimesheet,
    First(Filter(Table_SiteTimesheet,ID_Timesheet=varname)),
    {
    Work_Date: Value(Date_WorkDate_1.SelectedDate),
    Name_Project: DD_NameProject_1.Selected.Name_Project,
    Code_Project: DD_NameProject_1.Selected.Code_Project,
    Note: Text_Note_1.Text,
    Start: DD_StartTime_1.Selected.Value,
    End: DD_EndTime_1.Selected.Value,
    User_Name: User().Email,
    ModifiedOn_Date: Today()
    });

     

    Let me know if you dont understand or it doesnt work.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    Thank you so much, this is exactly what I was looking for. 🙂

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
wolenberg_ Profile Picture

wolenberg_ 119 Super User 2026 Season 1

#2
WarrenBelz Profile Picture

WarrenBelz 107 Most Valuable Professional

#3
Haque Profile Picture

Haque 103

Last 30 days Overall leaderboard