I have an office status app that shows team members that are out of the office on a certain date or range of dates. If team members are out of the office, their name and their Office365Users image displays in a gallery. Some members don't have an image, so I'm conditionally displaying a generic icon in that case. My issue though is if no team members are out on a given day, an error is thrown for passing an invalid parameter (blank) to the Office365Users function. It all seems to work fine when natively running the app, but when viewed in Teams the error messages are displayed at the top.
I've tried adding a condition to check if the gallery is empty first, but it doesn't seem to work. Here's my setup.
User image Image property:
If(
!IsEmpty('OOO Gallery'),
If(
Office365Users.UserPhotoMetadata(ThisItem.'Team Member'.Email).HasPhoto = true,
Office365Users.UserPhotoV2(ThisItem.'Team Member'.Email)
)
)
User image Visible property:
!IsEmpty('OOO Gallery')
Icon Visible property:
If(
!IsEmpty('OOO Gallery'),
If(
Office365Users.UserPhotoMetadata(ThisItem.'Team Member'.Email).HasPhoto = false,
true,
false
)
)
Any help on what I'm doing wrong would be appreciated.