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

Re: interconnected combobox and dropdown box

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

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
MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

firstImage

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Apps Community!

Top Solution Authors
Top Kudoed Authors
Users online (6,663)