Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Power Apps - Microsoft Dataverse
Answered

Updating existing table row - Edit Form

(0) ShareShare
ReportReport
Posted on by 661

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

  • RandomDept Profile Picture
    661 on at
    Re: Updating existing table row - Edit Form

    That fixed it, thank you!

  • Verified answer
    v-xiaochen-msft Profile Picture
    on at
    Re: Updating existing table row - Edit Form

    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

  • Verified answer
    RandomDept Profile Picture
    661 on at
    Re: Updating existing table row - Edit Form

    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.

  • v-xiaochen-msft Profile Picture
    on at
    Re: Updating existing table row - Edit Form

    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

  • RandomDept Profile Picture
    661 on at
    Re: Updating existing table row - Edit Form

    Apologies, missed that bit...

     

    Yes I can confirm a new gallery returns a match.

     

    wewt.png

     

     

  • v-xiaochen-msft Profile Picture
    on at
    Re: Updating existing table row - Edit Form

    Hi @RandomDept ,

     

    So does the lookup function return any outputs?

    Best Regards,

    Wearsky

  • RandomDept Profile Picture
    661 on at
    Re: Updating existing table row - Edit Form

    Currently just as 'Text'

  • v-xiaochen-msft Profile Picture
    on at
    Re: Updating existing table row - Edit Form

    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

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Apps - Microsoft Dataverse

#1
stampcoin Profile Picture

stampcoin 17

#2
ankit_singhal Profile Picture

ankit_singhal 11 Super User 2025 Season 1

#3
mmbr1606 Profile Picture

mmbr1606 9 Super User 2025 Season 1

Overall leaderboard

Featured topics