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 Gallery Item ...
Power Apps
Unanswered

Check if Gallery Item was selected

(0) ShareShare
ReportReport
Posted on by 51

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)

Categories:
I have the same question (0)
  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    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!

  • FerrDiBarnes Profile Picture
    51 on at

    Right you are,  some items have no parole officer email,  which isBlank fixes .

     

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 796 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 327 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard