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

Gallery collection not sorting

Hi All

I have few Sharepoint lists with similar columns which I get into collection

   ClearCollect(MyCollection,List1);
   Collect(MyCollection,List1); 

MyCollection is Items property for MyGallery

If try to sort MyCollection by any column  (SortByColumns( MyCollection,"Column1") it doesnt change how its sorted in MyGallery

Anything I am doing wrong here?

Thanks

 

4 REPLIES 4
Super User
Super User

Re: Gallery collection not sorting

Hi @RomanKorchak 

Could you provide the actual column names that you are trying to sort.  The syntax for the function is:

 

 

SortByColumns( Table, ColumnName1 [, SortOrder1, ColumnName2, SortOrder2, ... ] )

 

 

The table can be a collection or datasource.  The ColumnName1 refers to the actual name of the column in the collection.  SortOrder refers to either Ascending or Descending.  The secondary sorts are optional as is the primary sort if it is Ascending.  Check the column names in the collection to make sure that they are the same.  The ColumnName must be enclosed in double quotation marks.  Capture.PNG For SharePoint and Excel data sources that contain column names with spaces, specify each space as "_x0020_". For example, specify "Column Name" as "Column_x0020_Name".

RomanKorchak
Level: Powered On

Re: Gallery collection not sorting

I checked column names and they are correct

RomanKorchak
Level: Powered On

Re: Gallery collection not sorting

Also tried    Sort( MyCollection,Column1) - still no luck 🙄

RomanKorchak
Level: Powered On

Re: Gallery collection not sorting

Also if I had a column name wrong I would see an error, but there is no errors or warnings 

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

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

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (4,553)