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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Apps / Combo Box - Sort Selec...
Power Apps
Answered

Combo Box - Sort Selected Items Ascending

(0) ShareShare
ReportReport
Posted on by 117

Hi,

 

I have a combo box that is based on a Share Point Choice field. The field called ColorsSelected displays the Share Point list combo box values display in ascending order as each choice is entered into the Share Point list:

Aqua

Blue

Green

Red

Violet

Yellow

 

If a user selects Red then Blue, the 2 items show as selected (Red, Blue) and that is how they are saved when I patch the data to back to Share Point.

 

I need to patch the selected combo box values in ascending order (Blue, Red). I know SortByColumns cannot be used with Choice fields so I used the Sort command. However it is not sorting the selected items back in ascending order: 

ColorsSelected: Sort(comboboxColors.SelectedItems,"Ascending")

 

Does anyone know if this is possible? Thank you!!

Categories:
I have the same question (0)
  • RandyHayes Profile Picture
    76,299 Super User 2024 Season 1 on at

    @luvagoldenk9 

    Please consider changing your Formula to the following for the update to your Choice field in SharePoint:

    ForAll(SortByColumns(comboboxColors.SelectedItems, "Value"), 
     {Value: Value, 
     '@odata.type': "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference"
     }
    )

    This will sort the values and provide the proper information to update the SharePoint column.

    I will be assuming that your Choice column allows for multiple selections.

     

    I hope this is helpful for you. 

  • Verified answer
    v-qiaqi@microsoft.com Profile Picture
    Microsoft Employee on at

    Hi@luvagoldenk9,

    Based on the issue that you mentioned, do you want to patch the sorted selected colors to the SP list?

    Could you please tell me that if the Combo Box is allowed multi select?

    I have a test on my side, please take a try as below:

    Add a Button and set the OnSelect property as below:

     

    Patch(
     'YourSPList',
     Defaults('YourSPList'),
     {
     'ColorsSelected ': Sort(
     ComboBox4.SelectedItems,
     Text(Value),
     Ascending
     )
     }
    )

     

    Note: In my scenario, I add a Gallery to display the 'ColorsSelected' column on time once it is updated.

    121801Gif.gif

    Regards,

    Qi

  • luvagoldenk9 Profile Picture
    117 on at

    Thank you for pointing the missing parameter. I needed to add the 'Text(Value)' to my Sort statement and it worked!

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!

Congratulations to the March Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 534

#2
WarrenBelz Profile Picture

WarrenBelz 416 Most Valuable Professional

#3
Valantis Profile Picture

Valantis 306

Last 30 days Overall leaderboard