cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
mokhawaja
Kudo Collector
Kudo Collector

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

17 REPLIES 17

Was working then broke recently with

"Office365Users.UserPhoto failed: The method 'UserPhoto' has an invalid value for parameter 'userid'" 

 

Had to make this change: 

 

If(!IsBlank(ThisItem.UserPrincipalName), Office365Users.UserPhoto(UserPrincipalName)

Thanks!

 

That solved my problem, but my previous formula displayed a sample photo if one did not exist and I'm not sure how to insert this:

 

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

 

Into this:

If(!IsBlank(ThisItem.Reviewer),Office365Users.UserPhoto(ThisItem.Reviewer.Email))

 

Any help appreciated.

Anonymous
Not applicable

I'm running into the same issue... seems PowerApps doesn't like handling expressions within the userID field.  Any idea what may be throwing this?  

 

 

Error message on iOSError message on iOS

 

Collection w/ User ID stored by roleCollection w/ User ID stored by role

 

button embedded code w/ no errorsbutton embedded code w/ no errors

 HTML embedded code w/ no errorsHTML embedded code w/ no errors

 

 

 

Anonymous
Not applicable

Hey - for the missing image when the user doesnt have an image uploaded to o365 - Brian Dang released a youtube clip showing you need to have an icon in place behind your image call - so then if your image call is empty, the icon image will show instead - here's his clip - https://www.youtube.com/watch?v=pWUnmtnbJmk

Anonymous
Not applicable

I was able to resolve my issue above.  The O365 user call may time out and return the error "invalid userid method" even if you're returning a properly formatted principal id.  Also, point of advice, if you have a mysterious or erroneous column in your collection(s) be sure to check any recently changed fields.  I've found that Powerapps is pretty quick on the autocomplete and sometimes I've mistakenly typed in a "clearcollect(image3_1)" or something similar with a recent image/object I've been working with.

 


@Anonymous wrote:

I'm running into the same issue... seems PowerApps doesn't like handling expressions within the userID field.  Any idea what may be throwing this?  

 

 

Error message on iOSError message on iOS

 

Collection w/ User ID stored by roleCollection w/ User ID stored by role

 

button embedded code w/ no errorsbutton embedded code w/ no errors

 HTML embedded code w/ no errorsHTML embedded code w/ no errors

 

 

 


 

gastroman
Frequent Visitor

Help please!!!

This error message is occurring when running the app in the iOS PowerApp app.

 

Works perfectly in the browser instance and the data loads as it should despite the error message.

Here is my code:

Concatenate(
    "<h2 style='margin-bottom: 0px !important'>",
    ThisItem.Member.DisplayName,
    "</h2><strong>",
    Office365Users.UserProfile(ThisItem.Member.Email).JobTitle,
    "</strong><br><ul><li>",
        ThisItem.'Unit:Division'.Value,
        "<br><ul><li>",
            ThisItem.'Unit:Group'.Value,
            "<br><ul><li>",
                ThisItem.Unit.Value,
                    "<h4></ul></li></ul></li></ul></li>P: ",
    First(Office365Users.UserProfile(ThisItem.Member.Email).BusinessPhones).Value,
    "<br>E: ",
    ThisItem.Member.Email
)

Thanks in advance.
PS. All list items have a member and I've tried the previous suggestions with IsBlank but made no difference.

BDunagan
Regular Visitor

@v-micsh-msft 

I saw your post advising to add a conditional check to the gallery to prevent communication. I have a screen set up that pulls Employee information from the Microsoft365Users connection into a collection named 'Employee'. On the screen, there is a gallery that pulls all users that directly report to the selected Employee using the formula in the screenshot below. When I navigate to another screen, then redo a search for an employee and view their Profile Screen we run into the "Microsoft365Users.UserProfile failed: The method 'UserProfile' has an invalid value for parameter 'userId'." The error does not show unless we have navigated away from the screen and then make our way back to the Profile screen.

 

 I have seen in posts and online forums that the conditional check in the Gallery 'Items' should fix the error but it did not fix the error for me. Changing the 'Id' fields to 'UserPrincipalName' did not help either. The error itself does not affect any functionality and the app works except for the error at the top of the screen. I need to get the error fixed before moving this to production.

 

*Note - This app started as the 'Org Browser' template in PowerApps. I have customized the app from there to suit the organizational needs.

 

 

Jim_P_0-1627986217253.png

Hi I am having the same issue, However it keeps returning the same 404 error after I applied this solution. 

Please help. 

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (3,082)