cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

The service returned an error: Office365Users Manager call

I am using the following formula to extract my Manager's email from Office 365 and assigning it to a field in powerApps.

 

Office365Users.Manager(User().Email))

 

This works fine for other users but not for me because the manager field is not populated for my role. As a result I get the following error:

 

Office365Users.Manager failed: {"status" "404" No manager found for specified user....

 

The result is to stop execution of the next command and throw this message on the screen.

 

How do I handle errors when using the Office365Users connection for fields that have no value? I have tried

 

If(!IsBlank(Office365Users.Manager(User().Email)), Office365Users.Manager(User().Email).Mail, "")

and

If(!IsEmpty(Office365Users.Manager(User().Email)), Office365Users.Manager(User().Email).Mail, "")

but it does not get past Office365Users.Manager(User().Email). I do have a valid email from Users().Mail.

9 REPLIES 9
Community Support
Community Support

Hi @Anonymous,

 

This seems to be the limitation of the Office365Users Connection (or saying the service).

If there is no Manager for the corresponding user ID, then the Office365Users.Manager() function would throw the error.

 

For example, consider if the user is CEO and he doesn't have a manager. For the Job Title, please consider change the formula with the following:

If(First(Manager).JobTitle<>"CEO", 

   Office365Users.Manager(First(Manager).Id).DisplayName,

   "This is CEO")

 

For JobTitle Changes, we may create a single record table , then use filter function to check. You can also define a single-column table with square brackets. An equivalent way to write the above:

 

[ "Strawberry", "Vanilla" ]

 

for example:

If(
   IsEmpty(
             Filter(["IT","Work", "CEO"],
                     Office365Users.MyProfile().JobTitle in ["IT","Work", "CEO"])
                      ),
  
  Office365Users.MyProfile().DisplayName,
  Office365Users.MyProfile().JobTitle)

The formula above would check if the JobTitle is within the value specified in the single column table ["IT","Work","CEO"], if the table returned by the filter is empty, which means the JobTitle doesn't match the value specified, then it will show the the User display Name, otherwise, it will show the JobTitle.

 

Adding some reference:

Understand tables and records in PowerApps

 

Hope the information above is helpful.

 

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.
Anonymous
Not applicable

that assumes you have a Manager...The call fails because I have no Manager assigned to my profile...others will have assigned managers.

 

Office365Users.Manager(my email)

 

We need a way to control error handling in this situation.

 

If(Error(Office365Users.Manager(my email)), do something else, )

Helper I
Helper I

Is there a solution to this yet?

the powerapp i'm working on is spitting the same error on launching for those users without a manager. the app still functions find however is it possible to hide this error on app launch?

Anonymous
Not applicable

adding in @EvanChakiMSFT to review and advise on this issue. 

 

@Anonymous

Power Automate
Power Automate

Unfortunately, this is a known issue that some have encountered. Specifically where the AAD properties don't include certain properties.

 

See more here:

https://docs.microsoft.com/en-us/connectors/office365users/#known-issues-and-limitations

 

Thank you for your patience as we work to enhance this connector.

Audrie

any solution to this yet?

I get this error and everyone in the organisation has a manager in their manager field!!

Helper I
Helper I

It has been 2 years and there's still no fix to this?

 

We just need a simple validation we can use in powerapps if a user has no manager.

As of now, the only workaround for me is to assign the user a manager of himself.

for validation, to use condition statement to compare if user's UPN = manager's UPN

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Check out the Power Apps Community Call for January 2021

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (4,021)