cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Advocate I
Advocate I

ComboBox DefaultSelectedItems From Option Set

How does one set the default selected item in a combo box when the items are set to an Option Set? 

 

Suppose I have a Car entity.  A field of the Car entity is Color.  Color is an option set ("Red, Blue, Yellow").  In the canvas app I have a combo box that displays the Color option set.  I'd like the combo box to default to the selected Color if it has already been set in the Car entity at some point earlier. 

 

I can't figure this one out.  I'm still new to Power Apps but this sure seems like it should be pretty simple and straightforward but I'm drawing a blank.

 

Thanks,

Dan

1 ACCEPTED SOLUTION

Accepted Solutions
Super User II
Super User II

Or taking your example. If the Items property of the Combo Box is set to:

Choices(Car.Color)

Say you want to set the DefaultSelectItems property of this combo box to "Blue", you can use:

[Color.Blue]

Or say there is a car record, CarA and you want to use its color as the DefaultSelectedItems, you can use:

[CarA.Color]

 

Let me know if this helps. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

 

View solution in original post

2 REPLIES 2
Super User II
Super User II

A combo box expects a table in the DefaulSelectedItems field. For example, if my Items property is ["Red", "Blue", "Orange"], then my DefaultSelectedItems property cannot be "Red", it has to be ["Red"] or ["Red", "Blue"]. 

 

Does that help?

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

Super User II
Super User II

Or taking your example. If the Items property of the Combo Box is set to:

Choices(Car.Color)

Say you want to set the DefaultSelectItems property of this combo box to "Blue", you can use:

[Color.Blue]

Or say there is a car record, CarA and you want to use its color as the DefaultSelectedItems, you can use:

[CarA.Color]

 

Let me know if this helps. 

 

---
If you like this reply, please give kudos (Thumbs Up). And if this solves your problem, please mark this reply as a solution by selecting Accept as Solution. This makes it easier for others to find answers to similar questions. 

 

Thanks!

Hardit Bhatia

Blog | Twitter | LinkedIn | Facebook | YouTube  |  Email

 

View solution in original post

Helpful resources

Announcements
secondImage

Experience what’s next for Power Apps

Join us for an in-depth look at the new Power Apps features and capabilities at the free Microsoft Business Applications Launch Event.

Power Apps Community Call

Power Apps Community Call: February

Did you miss the call? Check out the Power Apps Community Call here.

New Power Super Users

Congratulations!

We are excited to announce the Power Apps Super Users!

New Badges

New Solution Badges!

Check out our new profile badges recognizing authored solutions!

Top Kudoed Authors
Users online (37,152)