cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Casey-Lee
Helper I
Helper I

Search bar (using Filter) isn't searching as anticipated.

Hi there 

 

I generated a PowerApp through SharePoint which included a "search text box" however, when I type in the name of the sales consultant it doesn't filter accordingly and just goes blank. 

 

Please see screenshots below. 

 

BrowseGallery1 Items: SortByColumns(Filter([@'Pipeline App'], StartsWith(Title, TextSearchBox1_1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

 

Screenshot 1: 

1.png

 

App View: 

2.png

 

The "sales consultant" name is originally a choice field in SharePoint

 

Thank you for any assistance 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xida-msft
Community Support
Community Support

Hi @Casey-Lee ,

Could you please share a bit more about your scenario?

Do you also want to search your Gallery Items based on the 'Sales Consultant Name' column value (Choice type field)?

 

If you want to search your Gallery Items based on the 'Sales Consultant Name' column value (Choice type field), you should modify the original Sort formula within the Items property of the Gallery. The Original Sort formula could only be searched by 'Title' column.

 

I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Gallery to following formula:

SortByColumns(
              Filter(
                      [@'Pipeline App'], 
                      StartsWith(Title, TextSearchBox1_1.Text) || StartsWith('Sales Consultant Name'.Value, TextSearchBox1_1.Text)
              ), 
              "Title", 
              If(SortDescending1, Descending, Ascending)
)

or

SortByColumns(
              Filter(
                      [@'Pipeline App'], 
                      StartsWith(Title, TextSearchBox1_1.Text) || TextSearchBox1_1.Text in 'Sales Consultant Name'.Value
              ), 
              "Title", 
              If(SortDescending1, Descending, Ascending)
)

Note: Above formula may face a Delegation warning issue, if the amount of your SP List records is not more than 2000, you could ignore this warning issue. Please set the "Data rows limit for Non-delegable queries" option to maximum value -- 2000 within Advanced settings of App settings of your app.

If the amount of your SP List records is more than 2000, please check and see if the alternative solution I mentioned within the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Sort-gallery-with-multiple-fields/t...

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Delegation-Formula-Help/m-p/394039#...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xida-msft
Community Support
Community Support

Hi @Casey-Lee ,

Could you please share a bit more about your scenario?

Do you also want to search your Gallery Items based on the 'Sales Consultant Name' column value (Choice type field)?

 

If you want to search your Gallery Items based on the 'Sales Consultant Name' column value (Choice type field), you should modify the original Sort formula within the Items property of the Gallery. The Original Sort formula could only be searched by 'Title' column.

 

I have made a test on my side, please consider take a try with the following workaround:

Set the Items property of the Gallery to following formula:

SortByColumns(
              Filter(
                      [@'Pipeline App'], 
                      StartsWith(Title, TextSearchBox1_1.Text) || StartsWith('Sales Consultant Name'.Value, TextSearchBox1_1.Text)
              ), 
              "Title", 
              If(SortDescending1, Descending, Ascending)
)

or

SortByColumns(
              Filter(
                      [@'Pipeline App'], 
                      StartsWith(Title, TextSearchBox1_1.Text) || TextSearchBox1_1.Text in 'Sales Consultant Name'.Value
              ), 
              "Title", 
              If(SortDescending1, Descending, Ascending)
)

Note: Above formula may face a Delegation warning issue, if the amount of your SP List records is not more than 2000, you could ignore this warning issue. Please set the "Data rows limit for Non-delegable queries" option to maximum value -- 2000 within Advanced settings of App settings of your app.

If the amount of your SP List records is more than 2000, please check and see if the alternative solution I mentioned within the following thread would help in your scenario:

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Sort-gallery-with-multiple-fields/t...

https://powerusers.microsoft.com/t5/Building-Power-Apps-Formerly/Delegation-Formula-Help/m-p/394039#...

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi @v-xida-msft 

 

The first option works great! Thank yo very much . 

 

There is a delegation warning, however, my database size should never (I hope) exceed 2000 records. 

 

Kind Regards

Casey-Lee

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

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