cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

interconnected combobox and dropdown box

Hi,

 

So i have a table(staging table) that has 2 fields(project code and source name) Each project code has either "toc" or "gom" as a source name. I have project code using a combobox and source name using the dropdown box. in my app 

I currently have the dropdown box filtering on the selected combobox in the function below.

 

Distinct(Filter('[dbo].[BPATLoadStaging]', ProjectCode = ComboBox2.Selected.ProjectCode),SourceName)

 

Is there a way i can have the dropdown, not only show its atrributed value based on the project code selected, but also show both "toc" and "gom"(all values in the field pretty much). The attributed source code can stay highlighed. I just want it to default to showing the rest of the values in the field once the user clicks the drop down.

 

Also, is there a way i can get project code to also show all attributed project codes when "toc or "gom" is selected in the source code drop down?

2 REPLIES 2
Community Support
Community Support

Hi @Anonymous ,

Q1:

Do you want to the drop down both have the value of "toc" and "gom", the filtered value just need to be highlighted?

Could you tell me whether the combo box is multiple selection? (do you want to select multiple project code?)

Could you tell me the data type of project code and source name?

I've made a similar test for your reference:

 

I assume that combo box is single choice, project code and source name is text type.

1)display "toc" and "gom" in drop down

set drop down's Items:

Distinct('[dbo].[BPATLoadStaging]',SourceName)

2)highlight filtered value:

set the drop down's Default:

LookUp('[dbo].[BPATLoadStaging]', ProjectCode = ComboBox2.Selected.ProjectCode,SourceName)

set the drop down's SelectionFill:  Red

In this way, the filtered value's background will become red and all value of source name will display in the drop down list.

 

If  combo box is multiple selection, then the filtered value of source name maybe not single value too.

In this situation, I suggest you use combo box to display source name too.

Then, set the combo box's Items:

Distinct('[dbo].[BPATLoadStaging]',SourceName).Result

set the combo box's DefaultSelectedItems:

Distinct(Filter('[dbo].[BPATLoadStaging]', ProjectCode = ComboBox2.Selected.ProjectCode),SourceName).Result

 set the combo box's SelectionFill:  Red

In this way, the filtered value's background will become red and all value of source name will display in the combo box list.

 

Q2:

Do you want to filter project code based on the selection of source name drop down?

You could set the project code's DefaultSelectedItems:

Filter('[dbo].[BPATLoadStaging]', SourceName=drop down1.Selected.Result)

Then the combo box's defaultselecteditems will filter based on the selection of drop down.

If you want to display all filtered project code in a label, you could set the label's Text:

Concat(Filter('[dbo].[BPATLoadStaging]', SourceName=drop down1.Selected.Result),ProjectCode&";")

 

 

 

Best regards,

Community Support Team _ Phoebe Liu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Do you want to the drop down both have the value of "toc" and "gom", the filtered value just need to be highlighted? Yes. Pretty much all distinct values in the field

Could you tell me whether the combo box is multiple selection? (do you want to select multiple project code?) Just a single selection. No multiple selection.

Could you tell me the data type of project code and source name? Both are text in powerapps and varchar in the database

Everything else works except this:

Do you want to filter project code based on the selection of source name drop down?Yes

You could set the project code's DefaultSelectedItems:

Filter('[dbo].[BPATLoadStaging]', SourceName=drop down1.Selected.Result)

  I'm getting the attached error.

 

Helpful resources

Announcements
News & Announcements

Community Blog

Stay up tp date on the latest blogs and activities in the community News & Announcements.

Power Apps Community Call

Power Apps Community Call- January

Mark your calendars and join us for the next Power Apps Community Call on January 20th, 8a PST

PP Bootcamp Carousel

Global Power Platform Bootcamp

Dive into the Power Platform stack with hands-on sessions and labs, virtually delivered to you by experts and community leaders.

secondImage

Power Platform Community Conference On Demand

Watch Nick Doelman's session from the 2020 Power Platform Community Conference on demand!

Top Solution Authors
Top Kudoed Authors
Users online (9,232)