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

Combine Search and Sort

I have two different statement that work well separately and yield different search results when used individually. 

 

Search(GlobalKnowledgeBase, TextSearchBox1.Text, "Title", "Symptom", "Solutions", "Escalation_x0020_path")

 

SortByColumns(Filter([@GlobalKnowledgeBase], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))

 

How can I combine them to yield results from the entire list item?

5 REPLIES 5
Sid_Jafri
Responsive Resident
Responsive Resident

Hi @Dgreca 


SortByColumns(Search(GlobalKnowledgeBase, TextSearchBox1.Text, "Title", "Symptom", "Solutions", "Escalation_x0020_path"), "Title", If(SortDescending1, Descending, Ascending))

Please Thumbs up and accept as solution if my post helped you solve your issue.

RandyHayes
Super User
Super User

@Dgreca 

Please consider changing your Formula to the following:

 

SortByColumns(
    Search(
        GlobalKnowledgeBase, 
        TextSearchBox1.Text, "Title", "Symptom", "Solutions", "Escalation_x0020_path"
    ),
    "Title", 
    If(SortDescending1, Descending, Ascending)
)

 

 

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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

Thank you @RandyHayes 
It partially worked.
I am still not able to find a test document that is in the database.

RandyHayes
Super User
Super User

@Dgreca 

Can you provide a little more detail on your test of this?  What is it that you are testing to find and how are you going about that to show no results?

_____________________________________________________________________________________
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.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

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

The expression:
SortByColumns(Filter(GlobalKnowledgeBase, StartsWith(Title, TextSearchBox1.Text) || StartsWith('KB Item' , TextSearchBox1.Text)),"Title", If(SortDescending1, Descending, Ascending))
 
The above expression queries this SharePoint List:
 
Test:
When I search for the term Primavera it appears in the App
However, when I search for the term SSPR which I know to be in the list items in SharePoint.
 
There may also be an underlying issue searching inherited from SharePoint. Still a different expression will have the reverse results as illustrated above i.e.
Expression:
SortByColumns(Filter([@GlobalKnowledgeBase], StartsWith(Title, TextSearchBox1.Text)), "Title", If(SortDescending1, Descending, Ascending))
 
Results:
Test:
When I search for the term SSPR it appears in the App
However, when I search for the term Primavera which I know to be in the list items in SharePoint.

Hope this helps clarify the query. 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

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.

Top Solution Authors
Users online (1,486)