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 for blank value ...
Power Apps
Suggested Answer

Check for blank value in Filter

(1) ShareShare
ReportReport
Posted on by 126
I have a below code which shows or hide my data card based on the lookup from SharePoint list. If the below lookup condition is blank, the visible property should be set to true.  May i know how to achieve this?
 
LookUp(
        _Data,
        "FinComm" in 'Field to be hidden'.Value,
        'Hide?'
    )
 
 
DataCard Visible property
With(
    {
        _Data: Filter(
            'Data Source',
            'Type'.Value = Trim(DataCardValue48_2.Selected.Value) && 'Finance'.Value = Trim(DataCardValue6_1.Selected.Value)
        )
    },
    LookUp(
        _Data,
        "FinComm" in 'Field to be hidden'.Value,
        'Hide?'
    )
)
 
I have the same question (0)
  • Suggested answer
    WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    Probably something like this on the Visible property - you want to show the item if the 'Hide?' field is blank is in the first matching record in the lookup OR there is no record matching the lookup - is this what you mean ?
    With(
       {
          _Data: Filter(
             'Data Source',
             'Type'.Value = Trim(DataCardValue48_2.Selected.Value) && 
             'Finance'.Value = Trim(DataCardValue6_1.Selected.Value)
          )
       },
       IsBlank(
          LookUp(
             _Data,
             "FinComm" in 'Field to be hidden'.Value
          ).'Hide?'
       )
    )
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
  • Poweruser32490 Profile Picture
    126 on at
     
    If there is no record matching the below lookup, visible should be set to true. May i know how to achieve that?
     
    LookUp(
            _Data,
            "FinComm" in 'Field to be hidden'.Value,
            'Hide?'
        )
  • Suggested answer
    Haque Profile Picture
    3,653 on at
     
    Please try this:
     
    If(
        IsBlank(
            LookUp(
                _Data,
                "FinComm" in 'Field to be hidden'.Value,
                'Hide?'
            )
        ),
        true,  // Visible when no record found
        !LookUp(
            _Data,
            "FinComm" in 'Field to be hidden'.Value,
            'Hide?'
        )    // Otherwise visible only if 'Hide?' is false
    )
    
     
    1. LookUp(...) returns the 'Hide?' value for the first matching record or blank if none found.
    2. IsBlank(...) checks if no matching record exists.
    3. If no record is found, the card is visible (true).
    4. If a record is found, the card is visible only if 'Hide?' is false (negated by !).\
     
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    Exactly as I posted - use that code in the Visible property of the control you want to show/hide.
    With(
       {
          _Data: Filter(
             'Data Source',
             'Type'.Value = Trim(DataCardValue48_2.Selected.Value) && 
             'Finance'.Value = Trim(DataCardValue6_1.Selected.Value)
          )
       },
       IsBlank(
          LookUp(
             _Data,
             "FinComm" in 'Field to be hidden'.Value
          ).'Hide?'
       )
    )
    Your structure is correct as the In Filter is not Delegable, so your top "pre-filter" needs to be Delegable. I am also assuming: -
    • 'Field to be hidden' is a Choice or Lookup field in your SharePoint List.
    • The field 'Hide?' is another field in the same list
    • As I mentioned before, if either: -
      • The combined Filter and Lookup returns no records OR
      • The above finds a record, but 'Hide?' is blank (I suspect the first one is what you are looking for)
    then the control will be visible.
     
    You also might read this blog of mine - you do not need "both sides" of the equation - simply make a statement which is either true or false (the code above is true if the conditions I set out are met), and the Visible property of the control will be set directly to whether the statement is true or false.
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like ♥
    Visit my blog
    Practical Power Apps    LinkedIn  
     
  • WarrenBelz Profile Picture
    155,838 Most Valuable Professional on at
    A quick follow-up to see if you received the answer you were looking for. Happy to assist further if not.
     
    Please ✅ Does this answer your question if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider answering Yes to Was this reply helpful? or give it a Like â™¥
    Visit my blog
    Practical Power Apps    LinkedIn   

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 Launch!

Jump in, show your community spirit, and win prizes!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
Valantis Profile Picture

Valantis 424

#2
WarrenBelz Profile Picture

WarrenBelz 355 Most Valuable Professional

#3
11manish Profile Picture

11manish 290

Last 30 days Overall leaderboard