web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Patch command is creat...
Power Apps
Unanswered

Patch command is creating a new row rather than updating

(0) ShareShare
ReportReport
Posted on by 16

I am trying to Update a row in the dataverse using the Patch command but it is adding a new row instead. I have created a key column in both tables to Lookup on. Despite there being a match, it is creating a new row.

 

Here is the syntax I am trying to use:

 

ForAll(

//"SIPGridData10"     is a collection I want to patch to the table (SIP_Sales Summary Calculationss) in the dataverse

SIPGridData10,

Patch(
           'SIP_Sales Summary Calculationss',
                         LookUp('SIP_Sales Summary Calculationss',

//   'Summary Table Key' is the column ID in both the collection and the dataverse table
                         'Summary Table Key'= ThisRecord.'Summary Table Key),
           {

// These are the records I want to patch to the dataverse table (SIP_Sales Summary Calculationss)
                 'Summary Table Key': ThisRecord.'Summary Table Key',
                   Area_Test: Text(ThisRecord.Areap),
                  Prodhlvl3: Text(ThisRecord.PHLvl3p),
                 'Annu.figs':ThisRecord.Ann_netvalue
            }
)
)

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

    Hi @oladimejishodip ,

     

    Please try this:

    ForAll(
    
    //"SIPGridData10" is a collection I want to patch to the table (SIP_Sales Summary Calculationss) in the dataverse
    
    SIPGridData10 As temp,
    
    Patch(
     'SIP_Sales Summary Calculationss',
     LookUp('SIP_Sales Summary Calculationss',
    
    // 'Summary Table Key' is the column ID in both the collection and the dataverse table
     'Summary Table Key'= temp.'Summary Table Key),
     {
    
    // These are the records I want to patch to the dataverse table (SIP_Sales Summary Calculationss)
     'Summary Table Key': temp.'Summary Table Key',
     Area_Test: Text(temp.Areap),
     Prodhlvl3: Text(temp.PHLvl3p),
     'Annu.figs':temp.Ann_netvalue
     }
    )
    )

     

    Best Regards,

    Wearsky

  • oladimejishodip Profile Picture
    16 on at

    patchs.png

  • oladimejishodip Profile Picture
    16 on at

    Thank you for the support. I got this syntax error patchs.png

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

    Hi @oladimejishodip ,

     

    Try this:

    ForAll(
    
    //"SIPGridData10" is a collection I want to patch to the table (SIP_Sales Summary Calculationss) in the dataverse
    
    SIPGridData10 As temp,
    
    Patch(
     'SIP_Sales Summary Calculationss',
     LookUp('SIP_Sales Summary Calculationss',
    
    // 'Summary Table Key' is the column ID in both the collection and the dataverse table
     'Summary Table Key'= temp.'Summary Table Key'),
     {
    
    // These are the records I want to patch to the dataverse table (SIP_Sales Summary Calculationss)
     'Summary Table Key': temp.'Summary Table Key',
     Area_Test: Text(temp.Areap),
     Prodhlvl3: Text(temp.PHLvl3p),
     'Annu.figs':temp.Ann_netvalue
     }
    )
    )
  • oladimejishodip Profile Picture
    16 on at

    @v-xiaochen-msft 

    Thank you for your help. The code works perfectly. However, I want to ask why it was necessary to load into temp ( rename the collection) to sync back correctly.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 802 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 332 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 273

Last 30 days Overall leaderboard