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 / Default the MultiSelec...
Power Apps
Answered

Default the MultiSelectedItems in Combobox for Office365Users

(0) ShareShare
ReportReport
Posted on by

@WarrenBelz 

Hi

 

Can I have your thought on this?

So I have a Combo box, the Datasource is Office365Users. It is set to select multiple users. 

So I want to send all the selected items to SP column like this, so will be easier to view in View Mode.

 

With({_RUitms: RestrUsers.SelectedItems},
Concat(
ForAll(Sequence(CountRows(_RUitms)),
{_RUitms: Last(FirstN(_RUitms, Value)), seq:Value}
),
Text(seq) & ". " &
_RUitms.DisplayName & Char(10) &
"<"&_RUitms.Mail & ">" & Char(10)
))

 

So in Form Edit mode , I'm collecting this data to a Variable. So from the variable is it possible to lookup the email and select from the combobox. Want to set this rule in the Defaultselecteditems in the combobox.

 

indhaa_0-1626503148553.png

 

I was able to do this using comma during Concat and putting this code in the Defaultselecteditems

 

RenameColumns(Split(varSelectedItems, ","), "Result", "Value") .

 

It does select all the items in the combobox but it doesn't display them in the Label.

 

indhaa_1-1626503443750.png

 

Don't know what I'm doing wrong. Anyway I want to Concat using both Display Name and Email and Filter with Email since many user Name is not unique.

 

 

Categories:
  • indhaa Profile Picture
    on at

    @WarrenBelz   can help ?

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @indhaa ,

    You fundamental issue is nothing to do with your code - when you need to display multiple selected items in a combo box, the physical width of the box has to be able to display the items, otherwise it will simply show xxx items as it it doing for you.

    As for the rest of it, I parsed your code (please see if you can do this ion your posts - it saves a lot of time on this end)

    With(
     {_RUitms: RestrUsers.SelectedItems},
     Concat(
     ForAll(
     Sequence(
     CountRows(_RUitms)
     ),
     {
     _RUitms: 
     Last(
     FirstN(
     _RUitms, Value
     )
     ), 
     seq:Value
     }
     ),
     Text(seq) & ". " &
     _RUitms.DisplayName & Char(10) &
     "<"&_RUitms.Mail & ">" & Char(10)
     )
    )

    and without understanding your model, it is a bit difficult to comment.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • indhaa Profile Picture
    on at

    Hi

     

    Sorry about that.

    So I'm using the above code to patch to my SP List column.

     

    So what I want is during Form Edit Mode, to select these items as the defaultselecteditems in my combo box.

     

    Is it possible to do that if my data is like below

      1. Brian Jones <jones@gmail.com>

      2. Adam Jones<adam.J@gmail.com>

     

    I was able to do it if I patch the data like jones@gmail.com, adam.J@gmail.com and using this code RenameColumns(Split(varSelectedItems, ","), "Result", "Value")    in the defaultselecteditems in my combo box.

     

    However if it have more than 3 or 4 items it doesn't display all the items in the combo box.  That's why I have put a label but in the Form Edit Mode it is not showing them in the label. 

     

    The label code is Concat(Combobox.SelectedItems,ThisRecord.DisplayName & "," & Char(10)).  When I look inside the combobox these items are not selected like it is when I select it normally.  Hope I'm making sense to you

    indhaa_0-1626598411717.png

    It is not selected in the scroll bar and I'm assuming that's why not showing in the label.

    indhaa_2-1626599280631.png

     

     

    So I want to know two things

    1. Do I need to patch using "," to get the default selected items selected in the combo box. Or can I continue with the code I used and update this code RenameColumns(Split(varSelectedItems, ","), "Result", "Value")   to select the email on my data. If so can let me know how to do this. I tried but it not seem to be working

     

    2. what I need to amend in my label code to show the defaultselecteditems

    Concat(Combobox.SelectedItems,ThisRecord.DisplayName & "," & Char(10))

    indhaa_4-1626599701685.png

     

    Hope I'm making sense to you.

     

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    Hi @indhaa ,

    Assuming the valid output of your combo box is ComboBox.Selected.DisplayName then 

    Concat(
     Combobox.SelectedItems,
     DisplayName & "," & Char(10)
    )

    should work in a label.

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

     

  • indhaa Profile Picture
    on at

    Hi,

     

    Seem it is not an issue with my code. I'm trying using this as a guide https://www.fidelityfactory.com/blog/power-apps-multiple-default-values-in-a-combo-box but it seem this issue was faced by others based on the comment.

     

    As I told before, even though it shows as selected, it is not really selected in below part (You can see in the image) which causes the issue. So when I click on the submit button it just update my data to blank.

     

    indhaa_0-1626720961166.png

     

     

     

  • WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @indhaa ,

    Here is a test I just did - what is different in yours?

    ddConcat.gif

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • indhaa Profile Picture
    on at

    Sorry. I think you are not getting what I'm saying.

     

    So after you select the users in your example, you going to submit the Form, right . So afterwards you want the users to be selected by default in your Edit Form Mode. How do you do that. That's where I'm getting the issue. 

     

    If I select the users like how your are doing manually , it is showing in the label but if it is selected using the below code in the defaultselecteditems property during FORM EDIT,  It does select all the items in the combo box but it doesn't display them in the Label. Also it is patching blank values if I submit the form  again

     

    RenameColumns(Split(varSelectedItems, ","), "Result", "Value") .

    indhaa_0-1626759049952.png

     

     

  • Verified answer
    WarrenBelz Profile Picture
    156,526 Most Valuable Professional on at

    @indhaa ,

    That is a very non-standard workaround for the small effort of simply displaying the items at the bottom. I would have to build a model to test it (and then like you have found, it may not work). 

    When you have a standard multi-Select combo box (with the DefaultSelectedItems set to ThisItem.FieldName ) it will show all selected items in the drop-down list as below (I opened this in Edit Mode, but did not change it)

    WarrenBelz_0-1626760105206.png

    The Update of the Data Card is ComboBoxName.SelectedItems.

    As I have posted, you can display the selected items below if you want.

    What is it in this that does not meet your needs?

     

    Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

  • indhaa Profile Picture
    on at

    Hi

     

    I think because I have Multi Line text column on my SP list. I'm not getting like you. I was trying to patch to this Text column and get the items selected using Split in Edit mode as in the article but later I saw the comments from other saying it doesn't work. 

    Now I'm changing to Person or group column and testing like you. Am I doing it right now?

  • Verified answer
    indhaa Profile Picture
    on at

    Now after I changed to Person or Group column, it is ok now

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > Power Apps

#1
11manish Profile Picture

11manish 394 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 328

#3
WarrenBelz Profile Picture

WarrenBelz 324 Most Valuable Professional

Last 30 days Overall leaderboard