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
Solved! Go to Solution.
I sometime use a formula similar to this:
If(IsBlank(ThisItem.Email),SampleImage,Office365Users.UserPhotoV2(ThisItem.Email))
Does it help?
Thanks,
Luke
@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
I sometime use a formula similar to this:
If(IsBlank(ThisItem.Email),SampleImage,Office365Users.UserPhotoV2(ThisItem.Email))
Does it help?
Thanks,
Luke
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!
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
@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