web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Using ComboBox and Sor...
Power Apps
Unanswered

Using ComboBox and SortByColumns to sort multiple selections

(0) ShareShare
ReportReport
Posted on by 4

Hello,

 

I've currently got a combo box that is set to multi-select that I am using to try and use to sort by Multiple values. I have tried to use ComboBox3.SelectedItems but you cannot use a table for the columns name of the SortByColumns function. After reviewing some of the posts in this forum, I tried to do a concat to pass the values over but as per the documentation to sort by multiple columns you need to pass it in as ["value","Value","Value"] so I've come up with the following 

IWRDev_0-1709683774225.png

So that it will show correctly but keep on running into issues, I have just tried to conctact without the double quotations as well and it still doesn't show correctly.

 

Any ideas where I am going wrong? 

I have the same question (0)
  • WarrenBelz Profile Picture
    153,737 Most Valuable Professional on at

    Hi @IWRDev ,

    Can you please post the full code (in Text) that you are using

  • IWRDev Profile Picture
    4 on at

    Hi @WarrenBelz,

     

    The full SortByColumns code is around 305 lines did you want me to post it or put it into something like pastebin? 

     

    Regards

     

  • WarrenBelz Profile Picture
    153,737 Most Valuable Professional on at

    @IWRDev ,

    The relevant part will be a help - I am trying to establish the context in which you are using it

  • IWRDev Profile Picture
    4 on at

    @WarrenBelz 

     

    Just so save a wall of text, I removed the IF condition as it is quite cumbersome to read through. This condition is used in the items section of a gallery

    SortByColumns(
    IF(This condition does the item selection for the gallery via Filter())
     //"["&SortColumnItems&"]",
     //SortItems
     "["&Concat(ComboBox3.SelectedItems, Char(34) &SortColumn &Char(34),",")&"]",
     //Split(Concat(ComboBox3.SelectedItems, SortColumn,","),
     //Dropdown3.Selected.SortColumn,
     If(
     Sort_Ascending,
     SortOrder.Ascending,
     SortOrder.Descending
     )
    )

     

    The Combo box is outside of the gallery and the items are generated into a collection when the user loads the app. The table has 2 columns, one for Name and one for SortColumn. The Name is the display name shown to the user while the SortColumn is the name of the relevant column within the dataverse. I am able to sort if I used ComboBox3.Selected.SortColumn as it'll pull the last item selected, the combobox is a multi-selectable combobox

     

    The issue is that SelectedItems is a table, while I have to feed a string into the 2nd parameter of SortByColumns() 

  • WarrenBelz Profile Picture
    153,737 Most Valuable Professional on at

    @IWRDev ,

    Sorry I am not a Dataverse user - I have moved the post over to that forum

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 248 Most Valuable Professional

#2
Kalathiya Profile Picture

Kalathiya 209 Super User 2026 Season 1

#3
VASANTH KUMAR BALMADI Profile Picture

VASANTH KUMAR BALMADI 195

Last 30 days Overall leaderboard