cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Helper IV
Helper IV

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
Highlighted
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".

Highlighted
Helper IV
Helper IV

Re: Gallery collection not sorting

I checked column names and they are correct

Highlighted
Helper IV
Helper IV

Re: Gallery collection not sorting

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

Highlighted
Helper IV
Helper IV

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
August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

secondImage

Return to Workplace

Reopen responsibly, monitor intelligently, and protect continuously with solutions for a safer work environment.

secondImage

Super Users Coming in August

We are excited for the next Super User season.

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Users online (7,214)