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 / Patch -> Invalid argum...
Power Apps
Answered

Patch -> Invalid argument type. Expecting a record value, but of a different schema

(0) ShareShare
ReportReport
Posted on by 21
Patch(
appliedleave, // Data source to patch
Defaults(appliedleave), // Record to modify (if it exists) or new record (if it doesn't exist)
{'Leave Type': Gallery3.Selected.'Leave Type'.Value}, // Update the 'Leave Type' field with the value selected in Gallery3
{'From Date': 'from date'}, // Update the 'From Date' field with the value 'from date' (this should be a variable or control)
{'To Date': 'to date'}, // Update the 'To Date' field with the value 'to date' (this should be a variable or control)
{'Leave Title': TextInput1}, // Update the 'Leave Title' field with the value from TextInput1
{'Leave Description ': TextInput1_1}, // Update the 'Leave Description' field with the value from TextInput1_1
{ // Update the 'Requested By' field with user information
RequestedBy: {
'@odata.type': "#Microsoft.Azure.Connectors.Sharepoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(User().Email),
Department: "",
DisplayName: User().FullName,
Email: User().Email,
JobTitle: ".",
Picture: "."
}
},
{
RequestedTo: {
'@odata.type': "#Microsoft.Azure.Connectors.Sharepoint.SPListExpandedUser",
Claims: "i:0#.f|membership|" & Lower(_selectedapprover.Mail),
Department: "",
DisplayName: _selectedapprover.DisplayName,
Email: _selectedapprover.Mail,
JobTitle: ".",
Picture: "."
}
}
this is my code for a button. the gallery and the gallery item contains the code:
ClearCollect(_selectedapprover,Gallery4.Selected);
UpdateContext({_showSelectApprover:false})
the error message is:
lamshalp_0-1708661222550.png

please help me through this.

Thank you

Categories:
I have the same question (0)
  • Ethan_009 Profile Picture
    4,838 Moderator on at

    Hi @lamshalp ,

     

    This is an object/record data and you need to insert a text field which will be in this field.

    Ethan_R_0-1708665591031.png

    For example, if you have Name column in Approver then it would be like

    _selectedapprover.DisplayName.Name
    
    // OR 
    _selectedapprover.DisplayName.<AnyColumnName>

    Hope this helps

  • lamshalp Profile Picture
    21 on at

    the selectedapprover is an item that comes from :

    ClearCollect(selectedapprover,Gallery4.Selected);
    UpdateContext({_showSelectApprover:false})
    The solution you provided doesn't work. the items in the gallery are:
    Office365Users.SearchUser({searchTerm:searchapprover.Text})
  • Verified answer
    lamshalp Profile Picture
    21 on at

    I used First(selectedapprover).display name that fixed the problem

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 519 Most Valuable Professional

#2
11manish Profile Picture

11manish 489

#3
Haque Profile Picture

Haque 327

Last 30 days Overall leaderboard