cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oeskandarian
Frequent Visitor

Error message in the Staff Directory app in PowerApps.

Hi Everyone,

 

I have a staff directory app, and it is connected to our Office.com & MS Teams. I build the Org chart in the Exchange server ( Organization > Manager), but I can't add anyone for our CEO since he doesn't have a manager. Here's the issue, when I search and click on his name in the app, it throws an error that this user doesn't have a manager. Here's the code

ClearCollect(Employee, ThisItem);
ClearCollect(PreviousEmployee, Employee);
Clear(Manager);Collect(Manager, Office365Users.Manager(First(Employee).Id));
Navigate(OrganizationScreen, Fade)

 

Here's the error message:

Office365Users.Manager failed: { "status": 404, "message": "No manager found for the specified user.\r\nclientRequestId: 4ace4eff-4622-456e-a4c1-e75ccaf9ef35", "error": { "message": "No manager found for the specified user." }, "source": "office365users-eus.azconn-eus-01.p.azurewebsites.net" }

 

 

I thought of adding an IF statement or sth that it doesn't throw an error message for the CEO user.

 

Thanks, 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-bofeng-msft
Community Support
Community Support

Hi @Oeskandarian :

Firstly,let me explain why you encounted this problem.

If the target user does not have a manager, then there will be such an error, and this error cannot be eliminated. In addition, there is no other way to directly obtain whether the user has manage. Currently I think the only way is based on the user’s jobtitle Determine whether he has manage.

Secondly,the formula could be:

 

ClearCollect(Employee, ThisItem);
ClearCollect(PreviousEmployee, Employee);
Clear(Manager);

If(Office365Users.UserProfileV2(First(Employee).Id).jobTitle<>"CEO",

Collect(Manager, Office365Users.Manager(First(Employee).Id)));
Navigate(OrganizationScreen, Fade)

 

Best Regards,

Bof

View solution in original post

1 REPLY 1
v-bofeng-msft
Community Support
Community Support

Hi @Oeskandarian :

Firstly,let me explain why you encounted this problem.

If the target user does not have a manager, then there will be such an error, and this error cannot be eliminated. In addition, there is no other way to directly obtain whether the user has manage. Currently I think the only way is based on the user’s jobtitle Determine whether he has manage.

Secondly,the formula could be:

 

ClearCollect(Employee, ThisItem);
ClearCollect(PreviousEmployee, Employee);
Clear(Manager);

If(Office365Users.UserProfileV2(First(Employee).Id).jobTitle<>"CEO",

Collect(Manager, Office365Users.Manager(First(Employee).Id)));
Navigate(OrganizationScreen, Fade)

 

Best Regards,

Bof

Helpful resources

Announcements
Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on August 17, 2022 at 8am PDT.

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Users online (4,867)