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

The service returned an error: Office365Users!Manager

we are user Office365Users connection in the PowerApps app to get the logged in user's Manager e-mail address
This is the function:
Office365Users.Manager(User().Email).Mail

When the app is opened the below message is shown:
The service returned an error: Office365Users!Manager: THe method 'Manager' has an invalid value for parameter 'userId'

The Manager's e-mail is retrieved though.

1 ACCEPTED SOLUTION

Accepted Solutions
Anonymous
Not applicable

Re: The service returned an error: Office365Users!Manager

Hi  ,

 

URL:  https://powerusers.microsoft.com/t5/PowerApps-Forum/Office-365-Profile-Information-getting-user-mana...

 

The URL above which you have posted says the user is not available but here the user is available in AD and is able to fetch the manager email as well.

 

However i feel the roundabout solution to avoid that error is i have taken  the logged in user into a text field and passed the text value into the Office365Users.Manager(Text Value).Mail. Then the error is not seen, I don’t think its related to Azure directory. 

 

Regards

Bharathi 

 

 

 

View solution in original post

10 REPLIES 10
Community Support Team
Community Support Team

Re: The service returned an error: Office365Users!Manager

Hi Bharathi,

 

Get-Manager is indeed tied to your Azure directory and not SharePoint online. So please make sure you fill the Manager filed of the user in Azure Active Directory.

 

Please find what the real email id of your manager should be as in AAD. There are a couple of ways – for example
Get-AzureRmADUser -SearchString "raj" (shows all matches)


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
IngeborgNZ
Level: Powered On

Re: The service returned an error: Office365Users!Manager

I have the same issue and I don't understand what you are suggesting, @v-yamao-msft

 

I have a people field in my form called "Operator", which comes from a SharePoint list. That people field has a property Email, which I can retrieve with ThisItem.Operator.Email and write it to a text box.

 

But when I put it into the "Manager" function, like this:

 

Office365Users.Manager(ThisItem.Operator.Email).DisplayName

 

... it shows a red squiggly line and the message "The service returned an error. Office365Users.Manager: The Method 'Manager' has an invalid value for parameter 'userID'. But at the same time it shows the correct manager in the field.

 

 

 2017-05-17_13-38-15.png2017-05-17_13-48-38.png

 

Can you please explain what you mean with Get-Manager or Get-AzureRmADUser??? How does that relate to Office365Users.Manager() and exactly what do we need to put into the formula in PowerApps when using the Office365User.Manager() function in Power Apps? 

Community Support Team
Community Support Team

Re: The service returned an error: Office365Users!Manager

Hi IngeborgNZ,

 

Please check this thread about “Office 365 User Get-Manager” not working for a reference:
https://powerusers.microsoft.com/t5/Connecting-To-Data/Office-365-User-Get-Manager-not-working/td-p/...

 

As staff @RajRa has mentioned in this thread, Get-Manager is indeed tied to your Azure directory and not SharePoint.

 

About how to use this function, please check this documentation:
https://powerapps.microsoft.com/en-us/tutorials/connection-office365-users/

 


Best regards,
Mabel Mao

Community Support Team _ Mabel Mao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Re: The service returned an error: Office365Users!Manager

Hi  ,

 

URL:  https://powerusers.microsoft.com/t5/PowerApps-Forum/Office-365-Profile-Information-getting-user-mana...

 

The URL above which you have posted says the user is not available but here the user is available in AD and is able to fetch the manager email as well.

 

However i feel the roundabout solution to avoid that error is i have taken  the logged in user into a text field and passed the text value into the Office365Users.Manager(Text Value).Mail. Then the error is not seen, I don’t think its related to Azure directory. 

 

Regards

Bharathi 

 

 

 

View solution in original post

Highlighted
IngeborgNZ
Level: Powered On

Re: The service returned an error: Office365Users!Manager

@v-yamao-msft Neither Bharathi nor I are using a command that is called "Get-Manager". The question that you linked to is about Flow. This question here is about Power Apps.

 

The function to retrieve a person's manager is working and retrieves the correct value, but it shows a warning as explained above.

 

From the help page you posted I understand that any email address text can be used in the command like this

 

Office365Users.Manager(<an email address goes here>).DisplayName

 

So, why does it show the error about invalid value for parameter 'userId' when at the same time it finds the correct result? How can we suppress the error?

 

 

 

 

 

IngeborgNZ
Level: Powered On

Re: The service returned an error: Office365Users!Manager

@Anonymous That workaround works for me, too. It seems that the Office365Users.Manager() function can only handle simple references to text boxes, but not more complex references. Well, it actually can handle them and returns the correct result, but some error checking is giving false positives.

 

@v-yamao-msft Can this error check be corrected, please?

IngeborgNZ
Level: Powered On

Re: The service returned an error: Office365Users!Manager

This thread has the solution: The formula is being evaluated before the referenced item has been filled in the gallery. The solution is to wrap the statement into an IF(!IsBlank( like below, then the cycling through the text box email is not required. 

 

If(!IsBlank(ThisItem.ThePersonField), Office365Users.UserProfile(ThisItem.ThePersonField.Email).<property>)

 

JC75
Level: Powered On

Re: The service returned an error: Office365Users!Manager

 

 

Disregard worked it out - I apply this to the manager datacard im populating in the default value

 

If(!IsBlank(DataCardValue12.Text),Office365Users.Manager(DataCardValue12.Text).Mail)

 

and that clears the error.

 

 

Anonymous
Not applicable

Re: The service returned an error: Office365Users!Manager

@JC75,

 

thank you, it works.

 

Best Regards,

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 (Last 30 Days)
Users online (4,823)