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

Notifications

Announcements

Community site session details

Community site session details

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

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,297 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
    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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Apps

#1
WarrenBelz Profile Picture

WarrenBelz 717 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 329 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard