cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Ben-00-38
Resolver I
Resolver I

How to combine Filter code and textbox

Hello, i can't write the correct code, can you help me?

 

I have a TextSearchBox and a Gallery.

 

The code of the gallery according to the two columns:

Depending on the items of two columns (one or the other) the rows are displayed in a Gallery.

Filter ('Customer account'; 'ATC_name (ATC)'. Email = varUser.Email || Sales Manager.Email = varUser.Email)

 

The gallery code for the TextSearchBox:

Filter ('Customer account'; TextSearchBox_2.Text in 'City (VIF_ADD)' || TextSearchBox_2.Text in 'Name (NM1_ADD)' || TextSearchBox_2.Text in Title)

 

How do you write the combination of the two codes so that the gallery displays only the values of the Filter code ('Client account'; 'ATC_name (ATC)'. Email = varUser.Email || ChefVente.Email = varUser.Email) and that I can filter with TextSearchBox?

 

Sans titre.png

1 ACCEPTED SOLUTION

Accepted Solutions
Drrickryp
Super User
Super User

Bon Jour @Ben-00-38 

 

With(
     {acct:Filter(
                  'Customer account'; 'ATC_name (ATC)'. Email = varUser.Email || 
                                       Sales Manager.Email = varUser.Email
            )
      },
      Filter(acct; TextSearchBox_2.Text in 'City (VIF_ADD)' || 
                   TextSearchBox_2.Text in 'Name (NM1_ADD)' || 
                   TextSearchBox_2.Text in Title
      )
)

Or 

With(
     {acct:Filter(
                  'Customer account'; 'ATC_name (ATC)'. Email = varUser.Email || 
                                       Sales Manager.Email = varUser.Email
            ), 
       City:'City (VIF_ADD)',
       Nom: 'Name (NM1_ADD)'
      },
    Search(
        acct,
        TextSearchBox2.Text,
        "Title",
        "City",
        "Nom"
    )
)

 

View solution in original post

2 REPLIES 2
Drrickryp
Super User
Super User

Bon Jour @Ben-00-38 

 

With(
     {acct:Filter(
                  'Customer account'; 'ATC_name (ATC)'. Email = varUser.Email || 
                                       Sales Manager.Email = varUser.Email
            )
      },
      Filter(acct; TextSearchBox_2.Text in 'City (VIF_ADD)' || 
                   TextSearchBox_2.Text in 'Name (NM1_ADD)' || 
                   TextSearchBox_2.Text in Title
      )
)

Or 

With(
     {acct:Filter(
                  'Customer account'; 'ATC_name (ATC)'. Email = varUser.Email || 
                                       Sales Manager.Email = varUser.Email
            ), 
       City:'City (VIF_ADD)',
       Nom: 'Name (NM1_ADD)'
      },
    Search(
        acct,
        TextSearchBox2.Text,
        "Title",
        "City",
        "Nom"
    )
)

 

RandyHayes
Super User
Super User

@Ben-00-38 

Please consider changing your Formula to the following:

Filter ('Customer account'; 
    ('ATC_name (ATC)'. Email = varUser.Email || Sales Manager.Email = varUser.Email) &&
    (
       TextSearchBox_2.Text in 'City (VIF_ADD)' || 
       TextSearchBox_2.Text in 'Name (NM1_ADD)' || 
       TextSearchBox_2.Text in Title
    )
)

I hope this is helpful for you. 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
NOTE: My normal response times will be Mon to Fri from 1 PM to 10 PM UTC (and lots of other times too!)
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

Helpful resources

Announcements
Power Apps News & Annoucements carousel

Power Apps News & Announcements

Keep up to date with current events and community announcements in the Power Apps community.

Community Call Conversations

Introducing the Community Calls Conversations

A great place where you can stay up to date with community calls and interact with the speakers.

Power Apps Community Blog Carousel

Power Apps Community Blog

Check out the latest Community Blog from the community!

Top Solution Authors
Top Kudoed Authors
Users online (1,774)