cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Kudo Collector
Kudo Collector

DefaultSelectedItems Using Variables for ComboBox

Hi Community - 

 

I am having some issues and hope that this may be a quick solve. I am looking to have the default selected item for my combox using a variable. I currently get the error "Expected Table value." I am setting the variable with on select & navigate from another screen and using this combox to filter the gallery on the current/new screen. This would be a huge user win if they are able to have the screen already filtered to the item they previously selected.

 

Any ideas how I can solve this? 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support
Community Support

Re: DefaultSelectedItems Using Variables for ComboBox

Hi @tlevine ,

Could you please share more details about the formula you used to initialize the ?

Do you want to set a default value within the ComboBox using a variable?

 

Based on the error message that you mentioned, it seems to tell that the DefautlSelectedItems property of the ComboBox is required to provide a Table value. Please check if you have set your variable as a Table value rather than a record value or single Text value.

 

I have made a test on my side, please consider take a try with the following workaround:

2.JPG

 

3.JPG

The data structure of RecordsCollection as below:

4.JPG

 

Set the OnSelect property of the "Initialize Var" button to following:

Set(DefaultOption, Table({ProductName: "Power BI"}))

On your side, you should initialize your variable as below:

Set(Var1, Table({DisplayColumn: "Specific Value"}))

Note: The DisplayColumn represents the column you used as display value within your ComboBox.

 

Please consider take a try with above sample solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
Highlighted
Kudo Collector
Kudo Collector

Re: DefaultSelectedItems Using Variables for ComboBox

 This video has gotten me closer, but still unable to get it to work while using a contextual variable:

 

https://www.youtube.com/watch?v=zxlmIwAP0i0 

Highlighted
Super User
Super User

Re: DefaultSelectedItems Using Variables for ComboBox

Without more details and based on the error message you are getting, I can tell that you are probably passing text as the defaultselected using a variable. You need to make sure it's a record of the items that populate the combo box.

Let me know the items property of the combo box, and how you are setting the variable which you want to use to set the defaultselected property.

---
If you like this reply, please give kudos. And if this solves your problem, please accept this reply as the solution. Thanks!

Hardit Bhatia
https://thepoweraddict.com
Highlighted
Community Support
Community Support

Re: DefaultSelectedItems Using Variables for ComboBox

Hi @tlevine ,

Could you please share more details about the formula you used to initialize the ?

Do you want to set a default value within the ComboBox using a variable?

 

Based on the error message that you mentioned, it seems to tell that the DefautlSelectedItems property of the ComboBox is required to provide a Table value. Please check if you have set your variable as a Table value rather than a record value or single Text value.

 

I have made a test on my side, please consider take a try with the following workaround:

2.JPG

 

3.JPG

The data structure of RecordsCollection as below:

4.JPG

 

Set the OnSelect property of the "Initialize Var" button to following:

Set(DefaultOption, Table({ProductName: "Power BI"}))

On your side, you should initialize your variable as below:

Set(Var1, Table({DisplayColumn: "Specific Value"}))

Note: The DisplayColumn represents the column you used as display value within your ComboBox.

 

Please consider take a try with above sample solution, then check if the issue is solved.

 

Best regards,

Community Support Team _ Kris Dai
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Helpful resources

Announcements
secondImage

Demo-Extravaganza 2020

Check out these cool Power Apps & vote on your favorite!

secondImage

Robotic Process Automation

Let's talk about the solution provided by Microsoft for Robotic Process Automation (RPA)

secondImage

Community Highlights

Check out whats happening in Power Apps

secondImage

Community User Group Member Badges

FIll out a quick form to claim your community user group member badge today!

secondImage

Power Platform 2020 release wave 2 plan

Features releasing from October 2020 through March 2021

Top Solution Authors
Top Kudoed Authors
Users online (10,665)