
Announcements
Dear community,
I have a gallery on my form that displays the employees from my Dataverse database but get's everybody's picture from
the Office 365 connector (msgraph).
When the employee is removed in Active directory (msgraph). I get an error in my app saying it can't get the the picture of the employee because his/her record doesn't exist anymore.
I allready build a check if the user that exist in msgraph doesn't have a profile picture. But I also need a check that if the user doensn't exist at all in msgraph show the picture EmptyProfile. Can this be done?
If(
'Office365-gebruikers'.UserPhotoMetadata(ThisItem.'E-mail').HasPhoto;
'Office365-gebruikers'.UserPhotoV2(ThisItem.'E-mail');
EmptyProfile
)
Gr. P
Hi @PeKi72
To display an empty profile picture if the user does not exist, you can modify your formula as follows:
If(
IsEmpty('Office365-gebruikers'.SearchUser({searchTerm: ThisItem.'E-mail'}));
EmptyProfile;
If(
'Office365-gebruikers'.UserPhotoMetadata(ThisItem.'E-mail').HasPhoto;
'Office365-gebruikers'.UserPhotoV2(ThisItem.'E-mail');
EmptyProfile
)
)If you have any questions or feedback, please let me know. Have a great day! 😊
-----------------------
PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻