cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Oeskandarian
Regular 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

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

secondImage

Experience what’s next for Power Apps

See the latest Power Apps innovations, updates, and demos from the Microsoft Business Applications Launch Event.

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (12,487)