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 -> Invalid argum...
Power Apps
Unanswered

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

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