cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kevin3
Level: Powered On

How to select more than one item in a combobox based off the selection of another combobox?

I have a combobox with a DataCardValue called "DataCardValueProfile" in a form connected to a SharePoint list.  The combobox has a list of role profiles a user can choose from which populates other fields in the form to streamline the process of completing the form.  All of the fields populate fine except when I try to populate more than one item for a combobox. 

 

The following works for populating one item in a combobox(Also connected to the same SharePoint list) called "DataCardValueCallCenterGroup"  but not for multiple items. 

Works

DefaultSelectedItems:   If(DataCardValueProfile.SelectedValue="Marketing",{Value: "Marketing Call Center"}) 

 

Not working with two values - But doesn't show any errors

 If(DataCardValueProfile.SelectedValue="Marketing",{Value:["Marketing Call Center","Client Call Center"}]) 

 

Should I be doing this with a filter instead? 

 

Thanks!

 

8 REPLIES 8

Re: How to select more than one item in a combobox based off the selection of another combobox?

Disregard.  I misread what you are trying to do.

 

You might need to do something like this:

 

Concat(ComboBox1.SelectedItems, Title & ", ")

Microsoft v-siky-msft
Microsoft

Re: How to select more than one item in a combobox based off the selection of another combobox?

@kevin3

 

What is the Items property of DataCardValueCallCenterGroup combo box? and what is the type of that column?

If it is a choices column, please try this:

 

 If(DataCardValueProfile.Selected.Value="Marketing", Filter(Choices('SP list'.ColumnName),Value="Marketing Call Center" || Value="Client Call Center"))

 

Sik

 

kevin3
Level: Powered On

Re: How to select more than one item in a combobox based off the selection of another combobox?

The item property is Choices('SPList'.CallCenterGroup)

 

I when I added the following to the Items property in DataCardValueCallCenterGroup it would only show the "Marketing Call Center" option to choose from and it wouldn't be selected like it is with the DefaultSelectedItems property.  

 

If(DataCardValueProfile.Value="Marketing",Filter(Choices('SPList'.DataCardValueCallCenterGroup),Value="Marketing Call Center"||Value="Marketing Call Center"))


I also tried changing || to && to see if the two options would show but it comes up as blank. 

 

Thanks!

Microsoft v-siky-msft
Microsoft

Re: How to select more than one item in a combobox based off the selection of another combobox?

@kevin3 

Which is the column name? which is the combo box name?

In my understanding, 'CallCenterGroup' is the column name, and the 'DataCardValueCallCenterGroup' is combo box name, so please modify the formula as follows.

Set DefaultSelectedItems property: 

 

If(DataCardValueProfile.Selected. Value="Marketing",Filter(Choices('SPList'.CallCenterGroup),Value="Marketing Call Center"||Value="Client Call Center"))

 

Sik

kevin3
Level: Powered On

Re: How to select more than one item in a combobox based off the selection of another combobox?

I tried that and the code doesn't have any errors but only selects one option like my code from the original post:

 

 If(DataCardValueProfile.SelectedValue="Marketing",{Value:["Marketing Call Center","Client Call Center"}]) 

 

I'm wondering if this just isn't supported in the Combobox control. 

 

Thanks!

Dual Super User
Dual Super User

Re: How to select more than one item in a combobox based off the selection of another combobox?

Hi @kevin3 

 

Can you try to update the formula to below expression and check if any of them suits:
 
If(DataCardValueProfile.Selected.Value="Marketing",["Marketing Call Center","Client Call Center"])
 
Filter(ItemsPassedinCombobox, If(DataCardValueProfile.Selected.Value="Marketing", Value in ["Marketing Call Center","Client Call Center"],false))
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
kevin3
Level: Powered On

Re: How to select more than one item in a combobox based off the selection of another combobox?

It looks like I'm getting a red underline under "Value" for the filter:

Filter(ItemsPassedinCombobox, If(DataCardValueProfile.Selected.Value="Marketing", Value in ["Marketing Call Center","Client Call Center"],false))

It says that the name isn't valid and the identifier isn't recognized 

Dual Super User
Dual Super User

Re: How to select more than one item in a combobox based off the selection of another combobox?

Hi @kevin3 

 

.Value needs to be replaced with .ColumnName in the expression.

I am assuming that column name is MyTestColumn, where you need to check "Marketing" as value, the expression should be:

Filter(ItemsPassedinCombobox, If(DataCardValueProfile.Selected.MyTestColumn ="Marketing", MyTestColumn in ["Marketing Call Center","Client Call Center"],false))

 

Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Top Kudoed Authors
Users online (10,969)