cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
PowerAppsHelpMe
Level: Powered On

Populating combo box based on drop down value selected and access the data

I want to populate a combo box from the selected data from another combo box or drop down. I want this to happen only when there is a value selected from a combo box, else display the current data (which has its own field). Combo box names:CB 1(the combo box that is selecting data) and CB 2 (the combo box to populate.
1 ACCEPTED SOLUTION

Accepted Solutions
Dual Super User
Dual Super User

Re: Populating combo box based on drop down value selected and access the data

Hi @PowerAppsHelpMe 

 

Yes thats correct, you need to select the attributes you want to use as Display and Search field. By default the editor selects one but if you want a different field to be displayed, this can be changed from the right menu item.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

8 REPLIES 8
Dual Super User
Dual Super User

Re: Populating combo box based on drop down value selected and access the data

Hi @PowerAppsHelpMe 

 

You can use the below expression on your Combobox 2 as:
 
If(IsBlank(ComboBox1.Selected),Filter(DataSource,Col1 = "Value1"),Filter(DataSource,Col1 = "Value2"))
 
This checks if the Combobox1 control selected value is blank and filter the results accordingly.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
PowerAppsHelpMe
Level: Powered On

Re: Populating combo box based on drop down value selected and access the data

What does “Coll” mean? Does this code only go into the items property of the combo box?
PowerAppsHelpMe
Level: Powered On

Re: Populating combo box based on drop down value selected and access the data

My combo box is searching one column from a data source. The value selected represents finding the row that someone wants and the items on that rows are auto populate into combo box and label. I can display the data on that row using labels, but combo box are giving me problems. I do not want the whole row, want an item that is on the same row as the combo box 1 value selected. This is extra information.
Dual Super User
Dual Super User

Re: Populating combo box based on drop down value selected and access the data

Hi @PowerAppsHelpMe 

 

Coll1 is the name of column that I used in my expression, this needs to be replaced with the Column Name.
 
Since you have only 1 row that you are trying to fetch, you can set the OnChange property of your combobox as:
 
Set(SelectedRecord,Lookup(DataSource,Col1 = Combobox1.Selected.Value))
 
Here, we are initializing a variable (SelectedRecord) to get the record value based on selection in Combobox control. Here, we are filtering the record where Col1 value is equal to combobox selected value.
 
Now, the label's Text property can be modified to: SelectedRecord.Name -> This will fetch the name for the associated record. This can be changed based on the column value you are trying to fetch.
 
Hope this Helps!
 
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
PowerAppsHelpMe
Level: Powered On

Re: Populating combo box based on drop down value selected and access the data

Thank you for helping me out. I am having issues with matching fields. Is there a way to get the data from the DefaultSelectedItems?
PowerAppsHelpMe
Level: Powered On

Re: Populating combo box based on drop down value selected and access the data

DefaultSelectedItems is working, but I would want to switch the matching field when the combo box is clicked on.
PowerAppsHelpMe
Level: Powered On

Re: Populating combo box based on drop down value selected and access the data

Sorry about that I figure it out with the default. I need to find how to change fields of the combo box. So i can display different field at different occasions.
Dual Super User
Dual Super User

Re: Populating combo box based on drop down value selected and access the data

Hi @PowerAppsHelpMe 

 

Yes thats correct, you need to select the attributes you want to use as Display and Search field. By default the editor selects one but if you want a different field to be displayed, this can be changed from the right menu item.
 
Hope this Helps!

If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

View solution in original post

Helpful resources

Announcements
New Ranks and Rank Icons in April

'New Ranks and Rank Icons in April

Read the announcement for more information!

Better Together’ Contest Finalists Announced!

'Better Together’ Contest Finalists Announced!

Congrats to the finalists of our ‘Better Together’-themed T-shirt design contest! Click for the top entries.

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

thirdimage

Community Summit North America

Innovate, Collaborate, Grow - The top training and networking event across the globe for Microsoft Business Applications

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