Showing results for 
Search instead for 
Did you mean: 
Level: Powered On

Question with Search Box Error

Hello all and thank you for your time in advance,


I have been trying to solve the following formula statement for the past 2 days and would appreciate some help from more experienced PowerApp users. I have the following situation that I would appreciate feedback on:


Problem Overview:

Using a search box to search titles in a gallery that is populated from a SharePoint list.


Intended Outcome:

  1. A user can use the sort button to show projects by low or high priority (this portion of the formula is working)
  2. A user can input text into a search box that will search project title like a general search (not working)



Current working formula statement that allows users to sort projects using the sort button:


SortByColumns(Filter(iMarketingData, Owner0 <> "Not Assigned"),"PriorityValue", 

My last attempt at making a good working formula statement to use a search box:

SortByColumns(Filter(iMarketingData, Owner0 <> "Not Assigned"),"PriorityValue", 
If(SortDescending1,Descending,Ascending) & 
Filter(iMarketingData, SearchTextInput.Text in Text(ProjectNameValue)))


The working formula gives me the following result, which is great:<br>

Search Box 1.JPG













The last attempt gives me the following result, I've racked my head many times trying to get the gallery to take the sort descending and the usage of the text search box:

Search Box 2.JPG

Community Support Team
Community Support Team

Re: Question with Search Box Error

Hi @thomasgarcia83,


I think there is something wrong with the formula that you provided within the Items property of the Gallery control in your PowerApps app.


The third parameter of the SortByColumns function is optional, which specifies the sort order of the table. The available values for the third parameter of the SortByColumns function are SortOrder.Descending and SortOrder.Ascending.


Please take a try with the following formula in the Items property of the Gallery control of your PowerApps app:

SortByColumns(Filter(iMarketingData, Owner0 <> "Not Assigned" && SearchTextInput.Text in Text(ProjectNameValue)),"PriorityValue",If(SortDescending1,Descending,Ascending))

More details about the SortByColumns function, please check the following article:

SortByColumns function



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.
Level: Powered On

Re: Question with Search Box Error



Thank you so much for the reply. I was looking for my post but could not locate it. I am glad you commented. I actually solved the situation late last week. I was so happy!


This is what worked in order for our users to search by their name in the text box. When a user lands on the page, the gallery locates the Owner0 column then filters the results so not to include "Not Assigned". That is reserved for another page. The formula then provides options for the user to either search by their name, using the SearchInput text box or they can arrange the results by priority by clicking on a sort icon.


It works marvelous and I hope this helps someone else in the future.


SortByColumns(Search(Filter(iMarketingData, Owner0 <> "Not Assigned"),
SearchInput.Text, "Owner0"), "PriorityValue", If(SortDescending1,Descending,Ascending))

Working Search Box - No Entry.JPGSearch Box - No Entry














Working Search Box - Name Entry.JPGWorking Search Box - Name Entry


Helpful resources

New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020


Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (5,092)