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 / need formula help for ...
Power Apps
Unanswered

need formula help for search

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

Hi,

 

I am noticing one of the common errors with search in powerapp. I put in the below formula for Items proeprty of gallery control, but gives me invalid arguements error:

 

SortByColumns(Search(Inspections, TextSearchBox1.Text, "Title","Location","Inspection_x0020_Site_x0020_Name"), "Title", If(SortDescending1, Descending, Ascending))

 

Title is the OOTB column of SharePoint list, Location and Inspection site name are choice drop-downs. Can someone help me correct the formula? Thanks in advance.

Categories:
I have the same question (0)
  • PaulD1 Profile Picture
    2,914 on at

    Can you break down the formula and build it up one piece at a time to see exactly where the error is occuring?

    E.g. start with Search(Inspections,TextSearchBox1.Text,"Title")

    Then add the other fields and finally the Sort.

    It is difficult to troubleshoot without knowing the data types of your fields and without being able to check the value in the variable SortByDescending1.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    I have mentioned the data types in question description, Title (OOTB text column), the other two are choice drop downs.

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @PaulD1

    the error comes up when I add the two choice columns in formula: Location and inspection site name, Thoughts?

  • PaulD1 Profile Picture
    2,914 on at

    Do the choice columns allow for multi-selection? If so, I think they will be returning tabular instead of text data which woul result in an error.

    I've just tested on choice fields with single-selection and it works as expected (although the formula is not delegable).

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    @PaulD1

     no, multiple values are not allowed. Can you share your formula, not sure If  my formula looks off.

  • PaulD1 Profile Picture
    2,914 on at

    I just used a datasource I happened to have on-screen:

    Search(RecommendedProduct, "litre", "Metric")

    Where "Metric' is a SharePoint choice column set to single selection (in the SharePoint list definition).

  • Community Power Platform Member Profile Picture
    Microsoft Employee on at

    So should I take off Sortbycolumns from my formula?I guess you are only using search right?

  • PaulD1 Profile Picture
    2,914 on at

    It's always good to try to build up formulae a little at a time, so start with the Search and if that works, then add on the SortByColumns.

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 July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 377 Most Valuable Professional

#2
11manish Profile Picture

11manish 165 Super User 2026 Season 2

#3
MS.Ragavendar Profile Picture

MS.Ragavendar 110 Super User 2026 Season 2

Last 30 days Overall leaderboard