cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mokhawaja
Level 8

the service returned an error: Office365Users!UserProfile

Hi,

I am using the connection of Office365Users, to view the Display name of the CreatedByUser field using this function:

Office365Users.UserProfile(ThisItem.CreatedByUser).DisplayName

the display name displays correctly but when i save the app and reopen it always show this error:

 

"the service returned an error: Office365Users!UserProfile: the method 'UserProfile' has an invalid value for parameter 'userId'

 

so i am not sure what's wrong with it.

 

best regards,

Mohammad AlkhawajScreenshot (5).png

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: the service returned an error: Office365Users!UserProfile

Hi @mokhawaja,

 

Please take a try to change the formula with the format below:

If(!IsBlank(ThisItem.CreatedByUser), Office365Users.UserProfile(ThisItem.CreatedByUser).DisplayName)

This would clear the error.

The error should be caused by Office365 call has been made before the Gallery has instantiated with all the values.

There should be updates being published on this soon.

Appreciate your patiencce.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

15 REPLIES 15
Community Support Team
Community Support Team

Re: the service returned an error: Office365Users!UserProfile

Hi @mokhawaja,

 

Thanks for the feedback.

Issue confirmed from my side.

 

The documentation for Office365 users shared the following information:

"

Note: If you're developing an app based on an entity in the Common Data Service, you can specify a user based on ID instead of email address.

For example, you can create an app automatically, add a screen that contains a Text box control, and set the control's Text property to this formula:
Office365Users.UserProfile(BrowseGallery1.Selected.CreatedByUser).DisplayName

If you create a contact and select that contact in the browse screen of the app, the Text box control will show your display name.

"

I think this issue should be related with the function only.

I will forward this from my side, will update here if I have any information received.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Community Support Team
Community Support Team

Re: the service returned an error: Office365Users!UserProfile

Hi @mokhawaja,

 

Please take a try to change the formula with the format below:

If(!IsBlank(ThisItem.CreatedByUser), Office365Users.UserProfile(ThisItem.CreatedByUser).DisplayName)

This would clear the error.

The error should be caused by Office365 call has been made before the Gallery has instantiated with all the values.

There should be updates being published on this soon.

Appreciate your patiencce.

Regards,

Michael

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

mokhawaja
Level 8

Re: the service returned an error: Office365Users!UserProfile

Thank you @v-micsh-msft... it works perfectly.

i just wonder why the exclamation mark? in the function:

 

If(!IsBlank...

 

regards,

Mohammad

 

Community Support Team
Community Support Team

Re: the service returned an error: Office365Users!UserProfile

Hi @mokhawaja,

 

It is the Logical negation, equivalent to the Not function.

See:

Operators and data types in PowerApps

 

Regards,

Michael

 

Community Support Team _ Michael Shao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
mokhawaja
Level 8

Re: the service returned an error: Office365Users!UserProfile

Thanks for the clarification @v-micsh-msft

 

Best regards,

Mohammad

LEARN_IT
Level: Powered On

Re: the service returned an error: Office365Users!UserProfile

Hello,

How about displaying other User information. I would like to display Photo, department, position. I'm getting that error.

Formula im using:

 

If(Office365Users.UserPhotoMetadata(ThisItem.Employee_x0020_Name.Email).HasPhoto=false,SampleImage,Office365Users.UserPhoto(ThisItem.Employee_x0020_Name.Email))

 

LEARN_IT
Level: Powered On

Re: the service returned an error: Office365Users!UserProfile

Error: powerapps office365users.userphoto failed: the method 'userphto' has an invalid value for parameter userid'

RaviChandra
Level: Powered On

Re: the service returned an error: Office365Users!UserProfile

How do I handle exception where no location exists in user profile? I am using the below formula. It works for those have location. But for others, it throws error. How do I handle this exception and display something like "NO Location"

 

If(!IsBlank( DataCardValue5_1.Selected.Email),Office365Users.UserProfile(DataCardValue5_1.Selected.Email).OfficeLocation)

 

Tried with IsError() formula, still I am unable to handle the Office365Users.UserProfile error.

 

Any help greatly appreciated,

 

Thanks!

Ravi

 

 

 

Yeong
Level: Power Up

Re: the service returned an error: Office365Users!UserProfile

I think this is a known bug. Please correct me if I am wrong.

 

For example, both following functions looks for userId not Text string as parameter.

 

Office365Users.Manager(userId)
Office365Users.UserPhoto(userId)

userId: User principal Name or email Id

 

When you provide text string as parameter then error pop-up.

Helpful resources

Announcements
thirdimage

Power Apps 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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors (Last 30 Days)
Users online (4,924)