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 / Invalid argument type ...
Power Apps
Unanswered

Invalid argument type (Table). Expecting a Record value instead.

(0) ShareShare
ReportReport
Posted on by 8

Hi all, 

 

I made the same app as the link below and everything worked fine untill I wanted to patch my data. The patch functions gives an error called "Invalid argument type (Table), Expecting a Record value instead. How can I solve this? 

 

Power Apps Editable Table/Gallery like Excel (Tutorial) - YouTube

 

App OnStart I have: 

ClearCollect(colTaskUpdates, 

 Defaults('Customer VAT') 

; 
Clear(colTaskUpdates) 
) 

 

In a gallery variable I have OnSelect: 

If(
 ThisItem.'Customer VAT ID' in colTaskUpdates.cr99c_customervatid,
 Update(
 colTaskUpdates,
 LookUp(
 colTaskUpdates,
 cr99c_customervatid = ThisItem.'Customer VAT ID'
 ),
 {
 cr99c_customervatid: ThisItem.'Customer VAT ID',
 cr99c_invoicenumber: InvoiceNumber_1.Text,
 cr99c_nettinvoiceamount: NettInvoiceAmount_1.Text,
 cr99c_vatamount: VATAmount_1.Text,
 cr99c_invoicedate: InvoiceDate_1.Text,
 cr99c_buyer: Buyer_1.Text,
 cr99c_countrycodebuyer: CountryCodeBuyer_1.Text,
 cr99c_vatidnumberbuyer: VATIDNumberBuyer_1.Text
 }
 ),
 Collect(
 colTaskUpdates,
 {
 cr99c_customervatid: ThisItem.'Customer VAT ID',
 cr99c_invoicenumber: InvoiceNumber_1.Text,
 cr99c_nettinvoiceamount: NettInvoiceAmount_1.Text,
 cr99c_vatamount: VATAmount_1.Text,
 cr99c_invoicedate: InvoiceDate_1.Text,
 cr99c_buyer: Buyer_1.Text,
 cr99c_countrycodebuyer: CountryCodeBuyer_1.Text,
 cr99c_vatidnumberbuyer: VATIDNumberBuyer_1.Text
 }
 )
)

 

The save button OnSelect has 

If( 

 CountRows(colTaskUpdates) > 0, 
 Patch( 
 'Customer VAT ID', 
 colTaskUpdates 
 ); 

 Notify( 
 "Succees", 
 NotificationType.Succees 
 ) 
); 

Clear(colTaskUpdates) 

 

In dataverse the data types of the following variables are: 

cr99c_customervatid: Unique Identifier
cr99c_invoicenumber: Text
cr99c_nettinvoiceamount: Currency
cr99c_vatamount: Currency
cr99c_invoicedate: Date Only
cr99c_buyer: Text
cr99c_countrycodebuyer: Text
cr99c_vatidnumberbuyer: Text

 

@Reza 

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

    Hi @Digdem ,

     

    You could try:

    If( 
    
     CountRows(colTaskUpdates) > 0, 
     Collect( 
     'Customer VAT ID', 
     colTaskUpdates 
     ); 
    
     Notify( 
     "Succees", 
     NotificationType.Succees 
     ) 
    ); 
    
    Clear(colTaskUpdates)

     

    Best Regards,

    Bof

  • Digdem Profile Picture
    8 on at

    Hi @v-bofeng-msft ,

     

    Thank you so much for your help. I changed my formula and the error messages are gone, however the data in dataverse is not changed. 

     

    When I make changes in my gallery this is saved in my collection and when I click on "save" button the collection items should overwrite existing items in dataverse. This is currenty not the case. Do you know how to solve this? 

     

    @EricRegnier @dpoggemann @ChrisPiasecki 

  • Digdem Profile Picture
    8 on at

    @EricRegnier @dpoggemann @ChrisPiasecki 

  • Drew Poggemann Profile Picture
    9,287 Most Valuable Professional on at

    Hi @Digdem ,

    Overall your code looks good to me.  My main concern is how you are populating some of the fields, maybe I am wrong but don't you need to convert?  Example your date field, wouldn't you need to populate the date field with a Date (https://docs.microsoft.com/en-us/power-apps/maker/canvas-apps/functions/function-datevalue-timevalue)  and for your currency something like:

    Currency:Value(TextInput2.Text)

    Sorry, don't do a ton with Canvas apps but this is what jumped out to me.  

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    Hi @Digdem, this you get this working afterall?  By "should overwrite existing items in dataverse" do you mean the items can created instead of updating. To update you can use Patch function and if you're using a form, try SubmitForm function to create/update. Hope this helps!

  • Digdem Profile Picture
    8 on at

    I mean the items can update. 

  • EricRegnier Profile Picture
    8,720 Most Valuable Professional on at

    @Digdem, thanks. Did you try the SubmitForm as per my previous post? This should work nicely and it's simply assuming you have a Edit form control (if not, suggest you have one). Cheers

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

Season of Sharing Community Challenge Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 414

#2
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#3
Kalathiya Profile Picture

Kalathiya 315 Super User 2026 Season 1

Last 30 days Overall leaderboard