cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
AnthonyPhan
Level 8

Set Default Selection of Combobox

Hi All,

I have a "Single-Select" Combobox with the items populated by a collection called "WorkOrderTable". I would like to set the default selection using formulas but have been unsuccessfull. I tried setting the "Default" property with the formulars shown below:
image.png

 

 

However no default selection is shown: 

image.png

 

How do set the default selection of a combobox using formula?

1 ACCEPTED SOLUTION

Accepted Solutions
Sienna
Level 10

Re: Set Default Selection of Combobox

If you want by default to have selected item then put your code from Default into DefaultSelectedItem property of combobox

View solution in original post

8 REPLIES 8
Sienna
Level 10

Re: Set Default Selection of Combobox

If you want by default to have selected item then put your code from Default into DefaultSelectedItem property of combobox

View solution in original post

AnthonyPhan
Level 8

Re: Set Default Selection of Combobox

Thanks @Sienna

 

I some how did not see the DefaultSelectedItem property. Works perfectly now.

skylitedave
Level 10

Re: Set Default Selection of Combobox

OMG!

After stuggling with how to set a default for a Combobox versus a regular dropdown or lookup fo rthe last 2 DAYS I stumbled upon this post.

 

Everything is the same as a regular Dropdown - meaning you use the wacky stuff below in the default of the datacard holding the combobox Except - see the trick below....  Here is a sample of the entry in teh default of the datacard

 

{ '@odata.type' : "#Microsoft.Azure.Connectors.SharePoint.SPListExpandedReference",
Id:0,
Value:  "20"}

  

The trick is to go into the combobox and set the property "DefaultSelectedItems" property in the data section of the combobox control to Parent.Default ...  it is blank when you create a new datacard...  I was putting Parent.Default into the Default property DOH!!! I want my 2 days back now 🙂

 

XenophonD
Level: Powered On

Re: Set Default Selection of Combobox

I just did the same thing. Two days of searching and then I found this post. However, I'm getting it to return a defualt result but then it doesn't show the results overall or even the value that is selected in the field. Just that something is selected.

skylitedave
Level 10

Re: Set Default Selection of Combobox

make sure to set the update property of the data card that holds the combobox to the combobox.selected..  you follow?

 

XenophonD
Level: Powered On

Re: Set Default Selection of Combobox

I wasn't using a datacard with my combo box but I was able to work through the issue. Turns out that when I added the defaultselecteditems property, it decided to change what values it was returning back. I had to change the DisplayFields and SearchFields back to what I originally had on that combobox and everything worked perfectly. Thanks for the help though!

MK1
Level: Powered On

Re: Set Default Selection of Combobox

Hi,

I'm also having same kind of issue.

In my scenario, 

I have a combo box which will be filtered based on values we choose from a Dropdown

DropDown= A, B,C

when a user selects A,C then there will be only 1 value in the combo box,

But when they choose B there will be multiple options on Combobox they need to select.

What my issue is: When a user selects A,C from dropdown a textbox should be populated with Combobox value automatically, but when user selects B they should be able to select options from combobox values.

How can i set the properties.

 texbox needs to be populated conditionally. like when they select A,C from dropdown then the textbox value should be the only value from combobox.

When they select B from the dropdown, they should be able to select 3 values from combobox and populate into the textbox.

textBox= Concat(combobox.SelectedItems,Result&",")

This is the formual i used on textbox.So what ever user selects on combobox will bepopulated into textbox

But textbox should be set to default combobox option when they select A,C from dropdown

digitaldanlim26
Level: Powered On

Re: Set Default Selection of Combobox

use ForAll function in DefaultSelectedItems property

 

ForAll(tableSource,Result)

Helpful resources

Announcements
thirdimage

Power Apps Super User Class of 2020

Check it out!

thirdimage

New Badges

Check it out!

thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Solution Authors
Top Kudoed Authors
Users online (5,780)