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 sorting of s...
Power Apps
Answered

Combo box sorting of submitted data

(0) ShareShare
ReportReport
Posted on by 24

I have a combo box where the options are populated from an excel sheet.  The options have been entered in a specific order in the excel sheet.

 

When a user submits my power apps form with the combo box data, the submission order of the combo box data is based on how the user inputted the options.  Instead, I want the submission to be based on the original excel sheet order.  How would I go about achieving this?

Categories:
I have the same question (0)
  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @RLautomate,

     

    You will have to use (or add) a column in your Excel table to keep track of the order via numbering (e.g. Id). You can then use this Id field to sort the selected input of the user via the Update property of the DataCard (not the combobox but the DataCard around it).

     

    The DataCard Update property should look similar to:

    //Change Id to the column used to keep track of the order
    Sort(DataCardValue.SelectedItems,ThisRecord.Id)

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • RLautomate Profile Picture
    24 on at

    Thank you for your suggestion.  I have existing code in the Update property for this datacard.  I added your suggestion but receive and error.  This is what I have in the update property:

    Left(
    Concat(ComboBox11.SelectedItems, Rooms & ", "),
    Len(Concat(ComboBox11.SelectedItems, Rooms & ", ")) - 2
    )
    Sort(ComboBox11.SelectedItems, ID)

    The column in my excel sheet is named "ID" and is the second column.  Any suggestions?

    Thanks in advance!

  • LaurensM Profile Picture
    12,516 Moderator on at

    Hi @RLautomate,

     

    You would have to work in the Sort() function within your existing code:

    Concat(
     Sort(
     ComboBox11.SelectedItems, 
     ID
     ), 
     Rooms, 
     ", "
    )

    As a note: concat will only add the separator when necessary - in other words, the last item will not have a separator at the end. However, the separator should be added as the third parameter and not via the & operator. By adding it as a third parameter, we can remove the Left(Len() - 2) code.

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

  • RLautomate Profile Picture
    24 on at

    This works great, thank you!  However, when I add ID's to each field in my excel, for example 1 through 50, it seems the think that the 11 item is supposed to be the second item once sorted.  Any idea how to fix this?

  • Verified answer
    LaurensM Profile Picture
    12,516 Moderator on at

    @RLautomate,

     

    It seems that the ID column is defined as a text column in the Excel list. You can define the column as a number or alternatively add the Value() function to the code block above:

    Concat(
     Sort(
     ComboBox11.SelectedItems, 
     Value(ID)
     ), 
     Rooms, 
     ", "
    )

     

    If this solves your question, would you be so kind as to accept it as a solution & give it a thumbs up.

    Thanks!

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 711 Most Valuable Professional

#2
Michael E. Gernaey Profile Picture

Michael E. Gernaey 319 Super User 2025 Season 2

#3
Power Platform 1919 Profile Picture

Power Platform 1919 268

Last 30 days Overall leaderboard