cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
dmistry
Level 8

need formula help for search

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.

8 REPLIES 8
Super User
Super User

Re: need formula help for search

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.

dmistry
Level 8

Re: need formula help for search

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

dmistry
Level 8

Re: need formula help for search

@PaulD1

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

Super User
Super User

Re: need formula help for search

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

dmistry
Level 8

Re: need formula help for search

@PaulD1

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

Super User
Super User

Re: need formula help for search

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

dmistry
Level 8

Re: need formula help for search

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

Super User
Super User

Re: need formula help for search

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.

Helpful resources

Announcements
thirdimage

Coming Soon: T-Shirt Design Contest

Keep your eyes open for our upcoming T-shirt design contest!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors
Users online (6,405)