Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

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
Community Support

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.
Helper III
Helper III

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))

Search Box - No EntrySearch Box - No Entry














Working Search Box - Name EntryWorking Search Box - Name Entry


Helpful resources

Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

Power Platform ISV Studio

Power Platform ISV Studio

ISV Studio is designed to become the go-to Power Platform destination for ISV’s to monitor & manage published applications.


Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Tech Marathon

Maratón de Soluciones de Negocio Microsoft

Una semana de contenido con +100 sesiones educativas, consultorios, +10 workshops Premium, Hackaton, EXPO, Networking Hall y mucho más!

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