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 to Dataverse not...
Power Apps
Answered

patch to Dataverse not working

(0) ShareShare
ReportReport
Posted on by

Hello,

 

I have created collection form my Dataverse table.

 

 

ClearCollect(MySales,salestable_A)

 

 

I made a excel like editable gallery.

That is working well. My gallery update MySales correctly.

My gallery is made to edit like excel and also to add a data form my item tabe. 

 

What I would like to do is to Patch(Update) MySales data to my Dataverse table "salestable_A". 

Following formula is to Update "salestable_A" but this is not working.

I have red line form ForAll and to the end.

Can somebody advice me what is wrong on my formula?

 

If(!IsBlank ---

is  to update  "salestable_A". 

I need to create to add new one also but I would like to solve update first.

 

ForAll(
 MySales, 
 If(!IsBlank(ThisRecord.salestable_A_id),

 Patch(salestable_A,
 ThisRecord,
 {cr9d1_qty: ThisRecord.cr9d1_qty,
 cr9d1_price: ThisRecord.cr9d1_price
 }
 )
 ));

 

 

 

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

    Hi @Anonymous ,

     

    Please use this formula:

    ForAll(
    
     MySales,
    
     If(!IsBlank(ThisRecord.salestable_A_id),
    
     
    
     Patch(salestable_A,
    
     LookUp(salestable_A, Column = ThisRecord.Column),
    
     {cr9d1_qty: ThisRecord.cr9d1_qty,
    
     cr9d1_price: ThisRecord.cr9d1_price
    
     }
    
     )
    
     ));

     

    After you put the table in the collection and modify the data, they are not equal.

    So you cannot use ThisRecord as the second parameter of the patch() function.

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • Community Power Platform Member Profile Picture
    on at

    @v-xiaochen-msft 

     

    Thank you so much for your help.

    I still have error message.😫

     

    apps.png

    apps2.png

     

  • v-xiaochen-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    What is the error message?

     

    Best Regards,

    Wearsky

  • Community Power Platform Member Profile Picture
    on at

    @v-xiaochen-msft 

     

    Hello, Thankyou for your continued support.

    This is my error message.😅

     

    pic001.png

     

  • v-xiaochen-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    I noticed that you used "ThisItem" in the formula.

    Could you tell me why you use it?

     

    You could try to delete 'ThisItem.' first to check if the formula works correctly.

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • Community Power Platform Member Profile Picture
    on at

    @v-xiaochen-msft 

    Hello,

     

    Thank you for your help!

    I have delete  'ThisItem.'.

    Still not working

     

    mssss_1-1616372132486.png

     

     

     

  • v-xiaochen-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    Could you tell me:

    What's data type of 'cr9d1_r_daily_report_ope_sales_figures_id' column in dataverse table?

    What's data type of 'qty' in dataverse table?

     

    In addition, please check that the column names are correct.

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

  • Community Power Platform Member Profile Picture
    on at

    @v-xiaochen-msft 

    Thank you for your help!
    This is my Dataverse setting.

     

     

     

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

    Hi @Anonymous ,

     

    I will suggest you to rename the columns of your collection. (Use RenameColumns() function)

    The column names of the table are the same as the column names of the collection, which may cause errors.

     

    Best Regards,
    Wearsky
    If my post helps, then please consider Accept it as the solution to help others. Thanks.

     

  • v-xiaochen-msft Profile Picture
    on at

    Hi @Anonymous ,

     

    You could also use MyTable[@fieldname] instead of fieldname .

     

    Best Regards,

    Wearsky

     

     

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard