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

Multiple options in SortbyColumns

Why is the below not working for me ?

 

I am trying to search the gallery using two of the items - title and location but i could make use of only one of them

 

SortByColumns(Filter(SPL, StartsWith(Title, TextSearchBox1.Text) || StartsWith(Location, TextSearchBox1.Text)),"Title","Location", If(SortDescending1, Descending, Ascending))

5 REPLIES 5
Microsoft Employee

Re: Multiple options in SortbyColumns

According to the documentation, the "Location" function returns a record of both latitude and longitude so you cannot compare it with a text value (see https://docs.microsoft.com/en-ca/powerapps/maker/canvas-apps/functions/signals)

Depending on the contents of your TextSearchBox1 control, you will have to use Location.Latitude, Location.Longitude or format the Location record in a custom way so it is presented as text.

Community Support Team
Community Support Team

Re: Multiple options in SortbyColumns

Hi @Suresh1409,

 

From your formula, it seems that your data source is a SharePoint list, right? If so, what is the column type of this "Location" column? 

 

If it is a Choice/Lookup column type for example, then your formula should be:

SortByColumns(Filter(SPL, StartsWith(Title, TextSearchBox1.Text) || StartsWith(Location.Value, TextSearchBox1.Text)),"Title","Location", If(SortDescending1, Descending, Ascending))

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Suresh1409
Level: Powered On

Re: Multiple options in SortbyColumns

Dear Mona, 

 

Glad to see your response 🙂 

 

Yes, I am using a sharepoint list and the format of the Title and Location is single line text.

 

After a little struggle in the last midnight, i have made it work with the below 

 

SortByColumns(Filter(SPL, StartsWith(Title, TextSearchBox1.Text) || StartsWith(Location, TextSearchBox1.Text)),"Title", If(SortDescending1, Descending, Ascending))

 

The above in fact worked both the ways(Title and Location) while sorting and fitering 

Suresh1409
Level: Powered On

Re: Multiple options in SortbyColumns

Dear Dinusc, 

 

Where can i learn powerapps quickly?

 

Its really difficult for me to spend a lot of time in searching and reading when someone is working for the whole day. I am ready to pay(reasonable cost) for a course and get the expertise level training. 

 

The information is avaiable only in office.com or youtube with random procedures and formulas to learn. Nothing is structured properly to learn it the way it should be.

Community Support Team
Community Support Team

Re: Multiple options in SortbyColumns

Hi @Suresh1409,

 

Sorry but the channel you mentioned is pretty much all the places you could find to learn about PowerApps. This is because that PowerApps is actually a quite new product that got a public launch November 1st 2016. I thought you might want to say it's Microsoft.com like https://docs.microsoft.com/en-us/powerapps/maker/. Here are blogs link that posted by pg and mvps: https://powerapps.microsoft.com/en-us/blog/.

 

Personally I would suggest that you could start from building auto-generated app using connections, and in this app, you could try to change formulas while learning the functions in PowerApps.

https://docs.microsoft.com/en-us/powerapps/maker/canvas-apps/formula-reference

 

Regards,

Mona

Community Support Team _ Mona Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors (Last 30 Days)
Users online (5,933)