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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Check if Gallery Item ...
Power Apps
Answered

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 493 Most Valuable Professional

#2
11manish Profile Picture

11manish 479

#3
Haque Profile Picture

Haque 328

Last 30 days Overall leaderboard