web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Check if the user exis...
Power Apps
Unanswered

Check if the user exist in MSGraph and if not display an empty profile picture

(0) ShareShare
ReportReport
Posted on by 1,042

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

 

Categories:
I have the same question (0)
  • Verified answer
    SpongYe Profile Picture
    5,603 Super User 2025 Season 2 on at

    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! 🍻

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 793 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 333 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard