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

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 Team
Community Support Team

Re: interconnected combobox and dropdown box

Hi @oria5467 ,

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.
oria5467
Level: Powered On

Re: interconnected combobox and dropdown box

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
thirdimage

Power Apps Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

sixthImage

Power Platform World Tour

Find out where you can attend!

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

SecondImage

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Top Kudoed Authors (Last 30 Days)
Users online (3,872)