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
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Microsoft Ignite 768x460.png

Find your focus

Explore the latest tools,training sessions,technical expertise, networking and more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Users online (2,876)