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

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

(0) ShareShare
ReportReport
Posted on by 124

I am new to Powerapps. I am building app on Power Apps for Teams invironment. I am trying to Patch the new record/change to the collection and give me this error "Invalid argument type (Table). Expecting a Record value instead.".

 

Patch funtion when user press Save button

Screenshot_3.png

Set(
 dataSaved,
 true
);
Patch(
 'Work Progress Trackings',
 colTaskUpdates
);
Clear(colTaskUpdates);
Set(
 X1,
 0
);
Notify(
 "Your grid changes have been successfully saved",
 NotificationType.Success,
 2000
)

 

Run on App "Onstart"

 

ClearCollect(
 colTaskUpdates,
 Defaults('Work Progress Trackings')
);
Clear(colTaskUpdates);
Set(
 dataSaved,
 true
);

 

 

Onchange funtion on the field box

If(
 ThisItem.'Work Progress Tracking' in colTaskUpdates.'Work Progress Tracking',
 Update(
 colTaskUpdates,
 LookUp(
 colTaskUpdates,
 'Work Progress Tracking' = ThisItem.'Work Progress Tracking'
 ),
 {
 'Work Progress Tracking': ThisItem.'Work Progress Tracking',
 Description: description.Value,
 'Due Date': date.Value,
 Progress: progress.Selected.Value,
 Priority: priority.Selected.Value,
 'Work Item': workitem.Value,
 Category: category.SelectedItems,
 'Assigned To': person.Selected.Mail,
 'Assigned To Display Name': person.Selected.DisplayName
 }
 ),
 Collect(
 colTaskUpdates,
 {
 'Work Progress Tracking': ThisItem.'Work Progress Tracking',
 Description: description.Value,
 'Due Date': date.Value,
 Progress: progress.Selected.Value,
 Priority: priority.Selected.Value,
 'Work Item': workitem.Value,
 Category: category.SelectedItems,
 'Assigned To': person.Selected.Mail,
 'Assigned To Display Name': person.Selected.DisplayName
 }
 )
);

 

Thank you in advance

Categories:
I have the same question (0)
  • CU-18081211-6 Profile Picture
    9,270 Moderator on at

    @daydinho10,

    Try:

     

     

    Patch(
     'Work Progress Trackings',
     ForAll(colTaskUpdates,ThisRecord)
    ) 

     

     

    Hope it helps !

  • daydinho10 Profile Picture
    124 on at

    Thanks for helping. it still show the same error. 

     

    Screenshot_1.png

     

    I noticed that onchange funtion when I deleted the two lines, it does solve the problem. However, how could I make this work? the below code is email picker which I use Classic Combobox. 

     

    I am following the youtube video from hear.

    https://www.youtube.com/watch?v=vRn7br2OaxE&list=PLTyFh-qDKAiHeIy4xwTFpz_03poNzPuQU&index=3

     

     

     'Assigned To': person.Selected.Mail,
     'Assigned To Display Name': person.Selected.DisplayName

     

  • Verified answer
    CU-18081211-6 Profile Picture
    9,270 Moderator on at

    colTaskUpdates colection should have the same structure as datasource.

    Use:

    ‘Assigned to’ : person.Selected

    without ‘Assigned to Display Name’

     

  • daydinho10 Profile Picture
    124 on at

    For those who got the same problem. Please double check the column Name in your table and your referrerence. My case it is because I have column name ‘Assigned To Display Name’ while I am putting â€˜Assigned to Display Name’ in my reference code.

  • ChrisOJ Profile Picture
    32 on at

    Another possible reason, why the function

    Patch(mytable, mycollection);

    may not work is that not all columns of the mycollection exist in the table mytable. If mycollection was used at another location in the app it is easily possible that mycollection contains columns that are not part of mytable.

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

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard