cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dlo4242
Regular Visitor

Filtering/searching a table with a search box

HI,

 

I am trying to use a search box to filter down my table. I get the table to filter down using only one column at a time. But what I want to do is be able to search 2 columns to filter even more.

 

what the table has now. 

Filter(Table1,StartsWith('Protocol /SC',SearchBox.Text)) 

 

I want to be able to still search with just that column or be able to search with that column + another column. So i want to be able to search 'Protocol/SC' then from that filter it down to 'Drug Name/Strength'. 

 

Any help would be appreciated. Thanks in advanced! 

13 REPLIES 13
StalinPonnusamy
Super User
Super User

Hi @dlo4242 

 

Try this

Search(Table1,SearchBox.Text, "Protocol /SC", "Column2") 

 


Thanks,
Stalin - Learn To Illuminate

StalinPonnusamy
Super User
Super User

Hi @dlo4242 

 

This is to avoid delegation. Sample code using my datasource

With(
    {item: [@IssueTracker]},
    Search(
        item,
        TextSearchBox1.Text,
        "Title",
        "Description"
    )
)

 


Thanks,
Stalin - Learn To Illuminate

what are you putting for the @IssueTracker. Is it a column on the table? 

 

Hi @dlo4242 

With(
    {item: TableName},
    Search(
        item,
        TextSearchBox1.Text,
        "Column1",
        "Column2"
    )
)


Thanks,
Stalin - Learn To Illuminate

dlo4242
Regular Visitor

This still doesn't work. Either I type in column1 or column2 for it to filter. But if I type in Column 1 and start to type column 2 it goes blank. 

 

dlo4242_1-1637763880873.png

 

 

Hi @dlo4242 

 

1. Please change the below

With(
{item: Table1},
Search(
item,

 

2. Is any error or not searching?

3. What are the field types for those columns? (It should be String column)

 


Thanks,
Stalin - Learn To Illuminate

dlo4242
Regular Visitor

1. So I changed it to item.

2. There are no errors. Its if I search with both columns typed in the search box I get no results. But if  I type just from the protocol column it will work or if I just type in a drug name. But if I try and add the two columns together nothing shows up. 

3. Not sure what you mean by that. The field type is a label? 

StalinPonnusamy
Super User
Super User

Hi @dlo4242 

 

I would like to make sure we are on the same page. When you type the keyword on the search box, It will search Both columns. In the below example, the search word is "test" which means it searches Title and Description

StalinPonnusamy_0-1637777398087.png

 

Is this your expectation or something different?


Thanks,
Stalin - Learn To Illuminate

dlo4242
Regular Visitor

Example one: I type in protocol and it will filter the "protocol" item field. 

dlo4242_0-1637781842724.png

 

Example 2: When I type in the Drug instead it will filter everything that has the word drug from the "Drug" field. 

dlo4242_1-1637781887131.png

 

Example 3: if I try to search both together to narrow it down, nothing shows. 

dlo4242_2-1637781937074.png

 

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

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