web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Question with Search B...
Power Apps
Unanswered

Question with Search Box Error

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

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", 
If(SortDescending1,Descending,Ascending))

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

Categories:
I have the same question (0)
  • v-xida-msft Profile Picture
    Microsoft Employee on at

    Hi @Anonymous,

     

    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,

    Kris

     

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @v-xida-msft,

     

    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

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the June Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 326 Most Valuable Professional

#2
11manish Profile Picture

11manish 168

#3
sannavajjala87 Profile Picture

sannavajjala87 75 Super User 2026 Season 1

Last 30 days Overall leaderboard