cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jchad
Level: Powered On

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.

7 REPLIES 7
Community Support Team
Community Support Team

Re: The service returned an error: Office365Users Manager call

Hi @jchad,

 

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.
jchad
Level: Powered On

Re: The service returned an error: Office365Users Manager call

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, )

asri_zainal
Level: Powered On

Re: The service returned an error: Office365Users Manager call

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?

Highlighted
Administrator
Administrator

Re: The service returned an error: Office365Users Manager call

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

 

@TopShelf-MSFT

Flow Staff Audrie-MSFT
Flow Staff

Re: The service returned an error: Office365Users Manager call

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

asri_zainal
Level: Powered On

Re: The service returned an error: Office365Users Manager call

any solution to this yet?

mbutterz
Level: Powered On

Re: The service returned an error: Office365Users Manager call

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

Helpful resources

Announcements
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 160 members 5,594 guests
Please welcome our newest community members: