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 person lookup fi...
Power Apps
Unanswered

Patch person lookup fields to SharePoint - CDS to Sharepoint

(0) ShareShare
ReportReport
Posted on by 7

Hi,

 

i have a app using CDS data and can patch all fields to sharepoint fine, Apart from the user lookup fields.

 

example of what works fine

Patch('Corporate Data Capture Data List', Defaults('Corporate Data Capture Data List'), {ContractNo: contractnossei.Text, Contractname: contractnamessei.Text, Selected_Contractor: selectedcontractorssei.Text, Title: projectnumberssei.Text, Project_x0020_Name: projectnamessei.Text, Inspection_x0020_Date_x0020__x00: InspectionDatessei.SelectedDate}); Navigate('Browse Screen',ScreenTransition.Fade) 

 

however when i try to patch the person field from the user entity i receive an error. Can data from a person lookup in CDS be saved into a sharepoint list and if so can people point me as to what im doing wrong?

 

List column is a person/group field

 

Error is invalid argument type. Expecting a record value, but of a differnt schema. Missing column. your formua is missing a column 'claims' with the type of text the function patch has some invalid arguments.

 

Site_x0020_Safety_x0020_Agreed_x94: ResponsiblepersonA1.Selected

 

Appreciate any help

 

Robert

 

 

 

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

    Hi @BobbyNWG1992 ,

     

    Do you want to update user information to SharePoint Person field?

     

    If you do, I made a test and you may modify your formula like below:

     

    Patch('Corporate Data Capture Data List',
     Defaults('Corporate Data Capture Data List'),
     {
     ContractNo: contractnossei.Text,
     Contractname: contractnamessei.Text, 
     Title: projectnumberssei.Text,
     Project_x0020_Name: projectnamessei.Text,
     Inspection_x0020_Date_x0020__x00: InspectionDatessei.SelectedDate,
     Selected_Contractor:If(IsBlank(Office365Users.SearchUserV2(searchTerm:selectedcontractorssei.Selected.Email)), 
     {
     '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
     DisplayName: selectedcontractorssei.Selected.'User Name',
     Claims: "i:0#.f|membership|" & selectedcontractorssei.Selected.'User Name',
     Department: "",
     Email: selectedcontractorssei.Selected.Email,
     JobTitle: "",
     Picture: ""
     },
     Office365Users.SearchUserV2(searchTerm:selectedcontractorssei.Selected.Email)
     )
     }
    )
    //assuming the "selectedcontractorssei" is a Combo Box

     

     

    And the reason to do this is because SharePoint Person type column is containing all users information in Azure AD with meta data, if you want to add new user into AAD, you’ll need to use those meta data, or use the LookUp function to find the existing user by comparing Email addresses. In above formula, we use Office365Users connector to check if that user is already in AAD.

     

    Hope this helps.

     

    Best regards,

    Community Support Team _ Jeffer Ni
    If this post helps, then please consider Accept it as the solution to help the other members find it.

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