cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate II
Advocate II

Office 365 User MetaData error

This week I have been creating an employee directory and need some assistance with an error I am receiving with the Office 365 user profile pictures to display. So far I have been receiving the error through the Office365User.UserMetaData error. 

I am going to attach two images that explain the issues and the details. 

 

Please if anyone could assist me with this that would be amazing?

Thank you and look forward to your response, 

 

Best,

AL

3 ACCEPTED SOLUTIONS

Accepted Solutions
Resolver II
Resolver II

I sometime use a formula similar to this: 

 

If(IsBlank(ThisItem.Email),SampleImage,Office365Users.UserPhotoV2(ThisItem.Email))

 

Does it help? 

 

Thanks, 

Luke

View solution in original post

The formula I gave you should work. Just make sure your datasource has an email address column and make sure you have the correct column name in the formula I gave you.

Perhaps find a particular user you know 100% has an image and see if theirs loads.

View solution in original post

@Ajilakes  I now understand what you need a bit more.

 

The formula I supplied -  I usually use to check if the row has an email address and then display a default image if the row does not contain an email. 

 

In your instance do all rows contain a email address? 

 

If they do I think your initial approach is actually correct. 

 

If(Office365Users.UserPhotoMetadata(ThisItem.Email).HasPhoto,Office365Users.UserPhotoV2(ThisItem.Email),User_no_photo)

If some of your rows do not have an email address, we might want to do something like this.

 

 

 

If(IsBlank(ThisItem.Email), User_no_photo, 
If(Office365Users.UserPhotoMetadata(ThisItem.Email).HasPhoto,Office365Users.UserPhotoV2(ThisItem.Email),User_no_photo))

what was the actual original error you were receiving. Sorry to go back to your original formula here! 

 

Luke

 

View solution in original post

10 REPLIES 10
Resolver II
Resolver II

I sometime use a formula similar to this: 

 

If(IsBlank(ThisItem.Email),SampleImage,Office365Users.UserPhotoV2(ThisItem.Email))

 

Does it help? 

 

Thanks, 

Luke

View solution in original post

Hi Luke,

 

The code itself only displays my profile picture and I am trying to get the profiles of the user's who have an Office365User profile pic and filter those that don't. I have attached the result of the code that you sent. 

 

Look forward to hearing back from you!

 

 

 

So the other two user profile boxes. How are they created? Is it a gallery you are using ?

Thanks
Luke

Yes, we are using a GalleryForm

 

I am going to attach an image of the Gallery. Hopefully, this helps 🙂

 

The formula I gave you should work. Just make sure your datasource has an email address column and make sure you have the correct column name in the formula I gave you.

Perhaps find a particular user you know 100% has an image and see if theirs loads.

View solution in original post

Hi Luke,

 

Everything works perfectly now! No more error whenever I transition screens to create a new user 🙂

 

One more issue I am having is from my first original post in the picture that shows a blank user profile icon. How would I be able to get that icon back on the user's that don't have an image? 

I assume you have an image called User_no_photo? 

 

If so, just ammend the formula as follows: 

 

If(IsBlank(ThisItem.Email),User_no_photo,Office365Users.UserPhotoV2(ThisItem.Email))

 

Basically it checks if the user has a photo, if it doesnt it will use an image named User_no_photo otherwise it users the profile picture. 

 

Glad it worked for you 🙂 

Luke 

I tried that exact code but it doesn't display the icon.

I am attaching the icon and the whole gallery with the code to show you the result.

 

Look forward to hearing from you 🙂

 

 

@Ajilakes  I now understand what you need a bit more.

 

The formula I supplied -  I usually use to check if the row has an email address and then display a default image if the row does not contain an email. 

 

In your instance do all rows contain a email address? 

 

If they do I think your initial approach is actually correct. 

 

If(Office365Users.UserPhotoMetadata(ThisItem.Email).HasPhoto,Office365Users.UserPhotoV2(ThisItem.Email),User_no_photo)

If some of your rows do not have an email address, we might want to do something like this.

 

 

 

If(IsBlank(ThisItem.Email), User_no_photo, 
If(Office365Users.UserPhotoMetadata(ThisItem.Email).HasPhoto,Office365Users.UserPhotoV2(ThisItem.Email),User_no_photo))

what was the actual original error you were receiving. Sorry to go back to your original formula here! 

 

Luke

 

View solution in original post

Helpful resources

Announcements
New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

Top Solution Authors
Top Kudoed Authors
Users online (26,320)