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 / Updating existing tabl...
Power Apps
Answered

Updating existing table row - Edit Form

(0) ShareShare
ReportReport
Posted on by 700

Hi All,

 

I have a single table to hold all the input data for a form split across two screens.

 

The Landing page / Screen1 simply has a Edit form and links to a table as a datasource. (tblConflictOfInterest).

Here is the first page on submit. The Default mode is New

(Would be great if I can set the textboxes so that they cannot be edited here as a side note, I pre-populate the values from Office365 looks ups if anyone knows a quick way around this.)

 

Set(varGUID, Office365Users.MyProfile().Id);
SubmitForm(formMyForm);
Navigate(Screen2)

 

On Screen2 I have another Edit form and have the below on a 'Next' button: This forms Default mode is Edit.

 

Patch(tblConflictOfInterests, LookUp(tblConflictOfInterests,EmployeeNumber = varGUID, { Controlling: InputControllingInterest.Text, CompanyOfficer: InputCompanyOfficer.Text, EmployeeNumber: varGUID }));
// This checks the current table for the existing record and matches the GUID

 

The two textboxes Screen2 are multiline text and map to the 'Controlling' and 'CompanyOfficer' cells.

 

Only issue is that instead of updating the existing row, it creates a new row.

I have checked to confirm the variable is indeed flowing to the second screen via a text field set to value of VarGUID.

 

Any ideas?

Thank you

RD

I have the same question (0)
  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @RandomDept ,

     

    Can I ask what's the data type of 'EmployeeNumber' column?

    And if you add a gallery with items 'LookUp(tblConflictOfInterests,EmployeeNumber = varGUID)', will it show any outputs?

     

    Best Regards,

    Wearasky

  • RandomDept Profile Picture
    700 on at

    Currently just as 'Text'

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @RandomDept ,

     

    So does the lookup function return any outputs?

    Best Regards,

    Wearsky

  • RandomDept Profile Picture
    700 on at

    Apologies, missed that bit...

     

    Yes I can confirm a new gallery returns a match.

     

    wewt.png

     

     

  • v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @RandomDept ,

     

    It's weird.

    Did you use patch function like above formula, and it created a new item rather than updating the existing item?

     

    I suggest you add a label to display the value of the variable(varGUID), so that we can monitor the change of the variable value when we patch the data.

     

    Best Regards,

    Wearsky

  • Verified answer
    RandomDept Profile Picture
    700 on at

    Did you use patch function like above formula, and it created a new item rather than updating the existing item?

    Correct, The code I used is:

     

    Patch(tblConflictOfInterests, LookUp(tblConflictOfInterests,EmployeeNumber = varGUID, { Controlling: InputControllingInterest.Text, CompanyOfficer: InputCompanyOfficer.Text, EmployeeNumber: varGUID }));
    // This checks the current table for the existing record and matches the GUID

     

    I suggest you add a label to display the value of the variable(varGUID), so that we can monitor the change of the variable value when we patch the data.

     

    Good news is this field is always showing the expected GUID.

  • Verified answer
    v-xiaochen-msft Profile Picture
    Microsoft Employee on at

    Hi @RandomDept ,

     

    I found that the parentheses in your formula are in the wrong position.

    Please try this:

    Patch(tblConflictOfInterests, LookUp(tblConflictOfInterests,EmployeeNumber = varGUID), { Controlling: InputControllingInterest.Text, CompanyOfficer: InputCompanyOfficer.Text, EmployeeNumber: varGUID });
    // This checks the current table for the existing record and matches the GUID

     

    Best Regards,

    Wearsky

  • RandomDept Profile Picture
    700 on at

    That fixed it, thank you!

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 530

#2
WarrenBelz Profile Picture

WarrenBelz 459 Most Valuable Professional

#3
Haque Profile Picture

Haque 314

Last 30 days Overall leaderboard