cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
TesDA
Continued Contributor
Continued Contributor

Transitioning DropDown to ComboBox - Issue with Default

I had a default set as such in my form drop down:

 

If(varFormMode = "edit", Gallery_Main.Selected.ProjDirName, If(varBackScr1 = "back", LookUp(App_PAFNewProj_Main,ID = varRecord.ID).ProjDirName, ""))

 

I tried putting that into the default in my combox but I am getting an error:

 

When I put it into Default I get:

Expected Record Value

 

When I put it into DefaultSelectedItems I get:

Expected Table Value

 

Let me know if you need anything else. What am I doing wrong?

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@TesDA 

I'm not sure why you transitioned then.  The Dropdown does not have a limit until you reach 500.  If you're not going to exceed that, I'd stay with the dropdown.  If you are, then the combobox will give you more records for sure.

Comboboxes work well, they are just totally different than a dropdown and this confuses many.  You have to work with them with records.

 

So, if you stick with the combobox, you'll need to change your DSI property to a record that is based off of the EmployeeData datasource that you have in the items property.

So, for example, LookUp(EmployeeData, DirectorFilter="Director" && ID=varRecord.ID)

This is just an example, replace with that which is relevant to your app.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

3 REPLIES 3
RandyHayes
Super User
Super User

@TesDA 

Comboboxes are much different than dropdown controls.  The only reason for a combobox is for search capability or multiple item selection.  So, if you have no need for either of them, I would drop back to a dropdown.

 

That said, you can ignore the Default property on the combobox - it does absolutely nothing.

The DefaultSelectedItems (DSI) property is the one that you will concern yourself with.

How the combobox differs from the dropdown is that, in a dropdown, you simply set the Default to the a text value for whatever your dorpdown is showing.  For a combobox, you must supply a record or a table of records (if you have multi-select enabled).  That record MUST match the schema of the Items property of your combobox.

 

So, the question then is, what is your Items property, and do you have multi-select enabled?

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!
TesDA
Continued Contributor
Continued Contributor

I'm switching to a combo-box because the data needs are greater then 250 rows. I dont love combo boxes since I've always found then quirky, so I dont use them often unless absolutely needed.

 

I have multi-select disabled. The requirement is only for 1 selected item.

 

Essentially if the person is pulling up the screen from a gallery, the default should be based on the gallery. If they are clicking the back button, the default should be whatever they had selected an sent to the sql database. Technically in both cases the data lives in sql.

 

Items:

Sort(Filter(EmployeeData, DirectorFilter = "Director"), 'Employee Name')

 

(the collection is based on the sql table App_PAFNewProj_Main)

 

Let me know if you need anything else.

RandyHayes
Super User
Super User

@TesDA 

I'm not sure why you transitioned then.  The Dropdown does not have a limit until you reach 500.  If you're not going to exceed that, I'd stay with the dropdown.  If you are, then the combobox will give you more records for sure.

Comboboxes work well, they are just totally different than a dropdown and this confuses many.  You have to work with them with records.

 

So, if you stick with the combobox, you'll need to change your DSI property to a record that is based off of the EmployeeData datasource that you have in the items property.

So, for example, LookUp(EmployeeData, DirectorFilter="Director" && ID=varRecord.ID)

This is just an example, replace with that which is relevant to your app.

 

_____________________________________________________________________________________
Digging it? - Click on the Thumbs Up below. Solved your problem? - Click on Accept as Solution below. Others seeking the same answers will be happy you did.
Check out my PowerApps Videos too! And, follow me on Twitter @RandyHayes

Really want to show your appreciation? Buy Me A Cup Of Coffee!

View solution in original post

Helpful resources

Announcements
2022 Release Wave 1 760x460.png

2022 Release Wave 1 Plan

Power Platform release plan for the 2022 release wave 1 describes all new features releasing from April 2022 through September 2022.

User Group Leader Meeting January 768x460.png

Calling all User Group Leaders!

Don't miss the User Group Leader meetings on January, 24th & 25th, 2022.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Top Solution Authors
Top Kudoed Authors
Users online (1,713)