cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sajarac
Super User
Super User

Office365User Photo Fails on Mobile but not in a Desktop

Hi there,

I am declaring the following variable OnStart =  Set(CurrentUser, User().Email); Set(CurrentUserName, User());

 

And I have an user picture with this formula:

Image = If( !IsBlank(CurrentUser),
If(Office365Users.UserPhotoMetadata(CurrentUser).HasPhoto = true,
Office365Users.UserPhotoV2(CurrentUser),
UserIcon
)

 

And also a lebel for the user name:

Text = Office365Users.UserProfileV2(CurrentUser).displayName

 

Running the app in my browser I have no problems.

 

But in in mobile device "IOS" I get this error:

 

Office365Users.UserProfileV2 failed: the method 'UserProfileV2' has an invalid value for parameter 'id'

 

Could somebody please provide help ?

 

Thanks in advance

1 REPLY 1
srose
Advocate II
Advocate II

You may have already resolved this, but just in case -- I found this here: https://thepoweraddict.com/office365users-connector-get-rid-of-this-warning/ .  My situation is that I have old users that no longer exist in AD, but I don't want to lose those records. So I use a boolean to determine if they exist first. AcctEnabled is a boolean:  IsEmpty(Office365Users.SearchUserV2({searchTerm:emailtext.Text}).value.Id). Then for the image:  If(Not(AcctEnabled),If(!IsBlank(Office365Users.UserPhotoV2(Label1.Text)),Office365Users.UserPhotoV2(Label1.Text)),'person icon')

 

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.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

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 (2,132)