cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
kjst
Frequent Visitor

Combo Box DefaultselectedItems value from text field

ComboBox Default values makes me crazy 🙂

I have ComboBox for  searching department from collection. Items: Distinct(CollUser,Department)

Also I want this ComboBox field to have default value from text field (another screen where department is loaded from user profile)

For this I give table as ComboBox wants DefeltselectedItems:Table({Value: txtGroup.Text})

 

All looks good and I can see this value in my combo box, but ... but Combo search value looks like is empty. I mean if i search with I don't get any results.

So how to get this value selected for search not only visible. 

(If i search for department and select it, everthing works fine)

Thanks guys for support in advance

1 ACCEPTED SOLUTION

Accepted Solutions
RandyHayes
Super User
Super User

@kjst 

You need to make sure that the records you have in the table of the DefaultSelectedItems property matches exactly the signature of the records in the items property.

In your case you have the Items property set using a Distinct formula.  Distinct returns a table with a single column called Result.

You are then trying to set the DefaultSelectedItems to a table that has records with a single column called Value.

These will NEVER match.

 

Either consider changing your DefaultSelectedItems property record to be Result instead of Value, or change the Items property and rename the Result column to Value.

 

I hope this is helpful for you.

_____________________________________________________________________________________
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

2 REPLIES 2
RandyHayes
Super User
Super User

@kjst 

You need to make sure that the records you have in the table of the DefaultSelectedItems property matches exactly the signature of the records in the items property.

In your case you have the Items property set using a Distinct formula.  Distinct returns a table with a single column called Result.

You are then trying to set the DefaultSelectedItems to a table that has records with a single column called Value.

These will NEVER match.

 

Either consider changing your DefaultSelectedItems property record to be Result instead of Value, or change the Items property and rename the Result column to Value.

 

I hope this is helpful for you.

_____________________________________________________________________________________
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

kjst
Frequent Visitor

Thanks @RandyHayes. You are the needed sugar to my brain this morning:) 

Just changed the Table to Result instead of Value and it works perfectly.

 

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Top Solution Authors
Top Kudoed Authors
Users online (2,101)