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
PA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

Welcome Super Users.jpg

Super User Season 2

Congratulations, the new Super User Season 2 for 2021 has started!

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.

Top Solution Authors
Top Kudoed Authors
Users online (948)