What is the conditional syntax to check if a gallery item has been selected?
I want to display the office365 userprofile.displayname based on a field (Parole officer email) in the selected gallery item.
If a Gallery item is not selected, the call to office365 generates an error because I am passing it an empty string instead of an email address:
Without a selected item
Office365Users.UserProfileV2(ThisItem.ParoleOfficeEmail).displayName) becomes
Office365Users.UserProfileV2("empty string").displayName)
Right you are, some items have no parole officer email, which isBlank fixes .
Hi @FerrDiBarnes,
In order to check whether a gallery item is selected you can use ThisItem.IsSelected , which will return true or false. That being said, ThisItem.ParoleOfficeEmail should not be dependent on the gallery selection since it is evaluated for each row individually.
The function may display errors for rows that do not have a ParoleOfficeEmail, the following may help instead:
If(
!IsBlank(ThisItem.ParoleOfficeEmail),
Office365Users.UserProfileV2(ThisItem.ParoleOfficeEmail).displayName)
)
If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.
Thanks!
WarrenBelz
146,776
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
66,093
Most Valuable Professional