cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
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
Highlighted
Resolver II
Resolver II

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

Highlighted
Resolver II
Resolver II

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

Highlighted
Resolver II
Resolver II

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
Highlighted
Resolver II
Resolver II

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

Highlighted
Advocate II
Advocate II

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!

 

 

 

Highlighted
Resolver II
Resolver II

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
Highlighted
Advocate II
Advocate II

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 🙂

 

Highlighted
Resolver II
Resolver II

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

Highlighted
Advocate II
Advocate II

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? 

Highlighted
Resolver II
Resolver II

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 

Highlighted
Advocate II
Advocate II

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 🙂

 

 

Highlighted
Resolver II
Resolver II

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
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

Top Solution Authors
Top Kudoed Authors
Users online (6,071)