cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Microsoft jobender
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
Microsoft jobender
Microsoft

Re: Contains Data Expression in Filtering a List

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
PowerApps Staff CarlosFigueira
PowerApps Staff

Re: Contains Data Expression in Filtering a List

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!

Microsoft jobender
Microsoft

Re: Contains Data Expression in Filtering a List

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
thirdimage

Power Automate Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (4,777)