cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
JimboSey
Helper III
Helper III

Populating a combobox in a form based on selection in another combobox within the form

Hello,

 

I have a form in my App, within it are several fields, two of which are comboboxes from choices columns in my SP list.

 

The first combobox has several choices for 'Issue'. Now depending on the issue choice selected for example 'broken link' I want to default combobox 2 (Priority), to default to 'Urgent' if broken link is selected at combobox 1. 

 

Then I want to employ same to all the other choices in combobox 1 to default combobox 2 to whatever priority I tell it to on selection at combobox 1.

 

Thank you.

2 ACCEPTED SOLUTIONS

Accepted Solutions
AmDev
Super User
Super User

Hi @JimboSey 

 

If you have a lot of potential scenarios, you could try a Switch statement like as follows and add this to the 'Default SelectedItems' property of your combobox2:

 

Switch(ComboBox1.Selected.Value,

"broken link", "Urgent",

"severed link", "normal priority",

"bruised link", "low priority"

)

 

You can add as many switch cases here as you like.

 

Hope this helps

View solution in original post

@AM if you do it this way it's likely that you will need to wrap the values into square brackets [] e.g.

Switch(ComboBox1.Selected.Value,
"A", ["A"],
"B", ["B"],
"C", ["C"]
)

View solution in original post

4 REPLIES 4
AmDev
Super User
Super User

Hi @JimboSey 

 

If you have a lot of potential scenarios, you could try a Switch statement like as follows and add this to the 'Default SelectedItems' property of your combobox2:

 

Switch(ComboBox1.Selected.Value,

"broken link", "Urgent",

"severed link", "normal priority",

"bruised link", "low priority"

)

 

You can add as many switch cases here as you like.

 

Hope this helps

C-Papa
Super User
Super User

Hi, try the below in the DefaultSelectedItems

 

If("broken link" in ComboBox1.SelectedItems,["Priority"])

 

to do another just add on to the end, e.g.

 

If("broken link" in ComboBox1.SelectedItems,["Priority"],If("SecondSelected" in ComboBox1.SelectedItems,["SecondResult"]))

 

 

@AM if you do it this way it's likely that you will need to wrap the values into square brackets [] e.g.

Switch(ComboBox1.Selected.Value,
"A", ["A"],
"B", ["B"],
"C", ["C"]
)

This worked great when adding the [] as @C-Papa suggested. Thanks both.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

May UG Leader Call Carousel 768x460.png

June User Group Leader Call

Join us on June 28 for our monthly User Group leader call!

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Users online (1,275)