cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Ajilakes
Level: Powered On

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
Luke_Timmins
Level 8

Re: Office 365 User MetaData error

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

Luke_Timmins
Level 8

Re: Office 365 User MetaData error

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

Luke_Timmins
Level 8

Re: Office 365 User MetaData error

@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
Luke_Timmins
Level 8

Re: Office 365 User MetaData error

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

Ajilakes
Level: Powered On

Re: Office 365 User MetaData error

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!

 

 

 

Luke_Timmins
Level 8

Re: Office 365 User MetaData error

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

Thanks
Luke
Ajilakes
Level: Powered On

Re: Office 365 User MetaData error

Yes, we are using a GalleryForm

 

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

 

Luke_Timmins
Level 8

Re: Office 365 User MetaData error

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
Level: Powered On

Re: Office 365 User MetaData error

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? 

Luke_Timmins
Level 8

Re: Office 365 User MetaData error

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 

Ajilakes
Level: Powered On

Re: Office 365 User MetaData error

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 🙂

 

 

Luke_Timmins
Level 8

Re: Office 365 User MetaData error

@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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (4,254)