Power Apps: Canvas Apps | Office365Users – Profile Errors


The Office365Users connector gets tricky when makers are working with incomplete user profiles. Especially when trying to display user profile photos. Does everyone have a picture? Even the contractors?


Unfortunately, everyone isn’t guaranteed to have an uploaded profile photo. Making the assumption that they do only invites future problems. To be proactive, default to the SampleImage, or another suitable stand-in, whenever there are issues like missing photos and/ or invalid accounts:

Figure 1 - Office365Users connector error.
Figure 1Office365Users connector error.

If(IsBlank(ThisItem.Email) 
     || IsError(Office365Users.UserPhotoMetadata(ThisItem.Email).HasPhoto) = true 
     || Office365Users.UserPhotoMetadata(ThisItem.Email).HasPhoto = false
     SampleImage,
     Office365Users.UserPhotoV2(ThisItem.Email)
)

Conclusion:
Don’t blindly assume every user account has a profile photo. Check and confirm, then default to another image if necessary.

“If you see a good fight, get in it.”

Vernon Johns

#BlackLivesMatter

Leave a comment