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 / AND in an IF Statement...
Power Apps
Answered

AND in an IF Statement on the visible property

(0) ShareShare
ReportReport
Posted on by 381

Hi,

I have this small line of code for an error message on the visible property of a label. 

 

If(DataCardValue4_1.Selected.Email <> User().Email, true)

 

Its looking at datacardvaue1_1... If the value does not equal the user logged in, then the error message is shown. 

I have several items. some items dont have a value, e.g. datacardvalue4_1 = blank... yet the condition above it met

 

How i add an extra bit of code to say, if datacardvalue4_1 <> user()email.email & datacardvalue4_1 IS NOT Blank, then true. 

 

i dont know how to incorporate the AND into the if statement

Thanks

Categories:
I have the same question (0)
  • zmansuri Profile Picture
    6,048 Super User 2024 Season 1 on at

    If(DataCardValue4_1.Selected.Email <> User().Email && !IsEmpty(DataCardValue4_1.SelectedItems), true,false)

  • Verified answer
    StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Vstar19 

     

    I assume datacardvalue4_1 is a text field

     

    DataCardValue4_1.Selected.Email <> User().Email && IsBlank(datacardvalue4_1.Text)

     

    If datacardvalue4_1 is combobo then

     

    DataCardValue4_1.Selected.Email <> User().Email && IsBlank(datacardvalue4_1.SelectedItems)

     

  • Vstar19 Profile Picture
    381 on at

    Hi. 

    What does the !IsEmpty mean?

     

  • StalinPonnusamy Profile Picture
    Super User 2024 Season 1 on at

    Hi @Vstar19 

     

    IsEmpty means is table is empty. Combobox SelectedItems returns Table. So we have to use IsEmpty for ComboBox and IsBlank for Text, Label

    I realized, If datacardvalue4_1 is combobo then

    DataCardValue4_1.Selected.Email <> User().Email && IsEmpty(datacardvalue4_1.SelectedItems)

     

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 329 Most Valuable Professional

#2
11manish Profile Picture

11manish 209 Super User 2026 Season 2

#3
Mohsin Ali Profile Picture

Mohsin Ali 179

Last 30 days Overall leaderboard