cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vanbeekpr
Advocate II
Advocate II

Office365Users.Manager fails if user email <> account id

I am using the following code to auto-populate a user's manager in a combo box (SP People Lookup field) based on the user selected in a Requester combo box (RequesterValue in code below, also an SP People Lookup field). 

{
  '@odata.type':"#Microsoft.Azure.Connectors.SharePoint.SPListExpandedUser",
  Claims:Office365Users.Manager(RequesterValue.Selected.Email).UserPrincipalName,
  DisplayName:Office365Users.Manager(RequesterValue.Selected.Email).DisplayName,
  Email:Office365Users.Manager(RequesterValue.Selected.Email).Mail
}

 

The code works as expected if the user's id and email address match in AD, e.g., email: usertest@corp.com, userid: usertest@corp.com. However, if the two do not match, e.g., email: usertest@corp.com, userid: testuser@corp.com, the code fails with a status 404, "No user found with the specified id." 

 

Has anyone else come across this? Seems to be a bug in the connector. Has anyone found a workaround?

 

Thanks,

Paul

 

2 REPLIES 2
v-monli-msft
Community Support
Community Support

Hi @vanbeekpr,

 

For Person or group Field which have Multiple selection enabled, you should use the code like following:

Patch(Patchtesting,Defaults(Patchtesting),
{ Title:"MultiPerson",
Multi_x002d_Person: Table( { Claims:"i:0#.f|membership|michael@testing.com", Department:"IT", DisplayName:"Michael Shao", Email:"Michael@testing.com", JobTitle:"", Picture:""}, { Claims:"i:0#.f|membership|test2@testing.com", Department:"", DisplayName:"Test2", Email:"Test2@testing.com", JobTitle:"", Picture:""}) } )

  

Please edit your formula and make it similar to this one and have a test again.

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Thanks, Mona, but it's not an issue of saving the value back to the underlying SharePoint list and the control is not multi-select. The issue is with pre-populating/defaulting the correct manager value in a second field based on the user selected/populated in the first field. 

Helpful resources

Announcements
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Power Query PA Forum 768x460.png

Check it out!

Did you know that you can visit the Power Query Forum in Power BI and now Power Apps

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

R2 (Green) 768 x 460px.png

Microsoft Dynamics 365 & Power Platform User Professionals

DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.

Users online (1,195)