cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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
Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

thirdimage

Power Apps Community User Group Member Badge

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

sixthImage

Join THE global Microsoft Power Platform event series

Attend for two days of expert-led learning and innovation on topics like AI and Analytics, powered by Dynamic Communities

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Microsoft Business Applications Virtual Launch

Join us for the Microsoft Business Applications Virtual Launch Event on Thursday, April 2, 2020, at 8:00 AM PST.

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Users online (7,456)