cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jobender
Microsoft
Microsoft

Contains Data Expression in Filtering a List

I am trying to filter my list before any search conditions are added.  In my Account source, I have some sample data I don’t want to show.  I can do that by applying a filter on the AccountNumber_ field.  So that the screenshot below only shows records where an Account Number contains data.  So Consolidate Messenger would be filtered out.

 

In looking at formulas at https://powerapps.microsoft.com/en-us/tutorials/add-gallery/, I have modified my formula to...

 

Sort(If(IsBlank(TextSearchBox1.Text), Account, Filter(Account, TextSearchBox1.Text in Text(OrganizationName))), OrganizationName, If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

 

I could change the logic to something like…

 

Sort(If(IsBlank(TextSearchBox1.Text), Filter(Account, AccountNumber_=”ACME1220”), Filter(Account, TextSearchBox1.Text in Text(OrganizationName))), OrganizationName, If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

 

However, I need to replace the equals statement to contains data.  Does anyone know what is the formula syntax to state only show records where AccountNumber_ contains data?

 

PowerApps List.png

1 ACCEPTED SOLUTION

Accepted Solutions

Very Close...  I had to make a few modifications, but that defintely helped.  Thanks.  Below is the finished statement.

 

Sort(
    If(
       IsBlank(TextSearchBox1.Text),
       Filter(Account, Not(IsBlank(AccountNumber_))),
       Filter(Account, Not(IsBlank(AccountNumber_)), TextSearchBox1.Text in Text(OrganizationName))),
   OrganizationName,
       If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

View solution in original post

2 REPLIES 2
CarlosFigueira
Power Apps
Power Apps

You can use the !IsBlank expression (not IsBlank) to check whether a column contains data, so your formula would look something like this:

Sort(
    If(
        IsBlank(TextSearchBox1.Text),
        Filter(Account, !IsBlank(AccountNumber_))
        Filter(Account, !IsBlank(AccountNumber_), TextSearchBox1.Text in Text(OrganizationName))),
    OrganizationName,
    If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

Hope this helps!

Very Close...  I had to make a few modifications, but that defintely helped.  Thanks.  Below is the finished statement.

 

Sort(
    If(
       IsBlank(TextSearchBox1.Text),
       Filter(Account, Not(IsBlank(AccountNumber_))),
       Filter(Account, Not(IsBlank(AccountNumber_)), TextSearchBox1.Text in Text(OrganizationName))),
   OrganizationName,
       If(SortDescending1, SortOrder.Descending, SortOrder.Ascending))

View solution in original post

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (62,598)