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

Combo Box Drop down - SQL Primary Key filtering

Hello,

1. I have linked to an SQL server and linked all my tables to the power app.

2. I can create drop-down or combo boxes with these tables and their respective row values within them.

3. I have then made the combo box dependant on the others value (this works for column values within the same table).

4. However when I try to select another table for it depend on it changes the actual data source to that table.

5. As I have set the fact tables with their primary keys in the SQL database I assumed the app would allow me to depend the dropdown on a fact table whilst still showing the value from the dimensional table.

 

As I have mainly used power BI, once you set the relationship up the intelligence does this for you.

 

I have been trying to find an answer, thinking the solution could be to create a collection, or a filter / lookup formula. Obviously if I put all these items in the same table that wouldn't be an issue, but this is not ideal for the SQL database.

 

Help appreciated.

 

Cheers

 
1 ACCEPTED SOLUTION

Accepted Solutions
eka24
Level 10

Re: Combo Box Drop down - SQL Primary Key filtering

You can start watching this cascading dropdown from Shane Young.
https://youtu.be/pkZG2boN7jQ

With the issue of filtering Sql primary key, I will advise you insert another column in your sql table. Then on your form include a number field that would be used for the filtering.
Kindly watch the video first. Also screenshot of your table would give clear view what you have pasted here.


If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution

View solution in original post

3 REPLIES 3
eka24
Level 10

Re: Combo Box Drop down - SQL Primary Key filtering

Your request is not clear. Do you want to pull one table based on the other? If so then a lookUp could be used. If you can restate you point
Johnnyboy1
Level: Powered On

Re: Combo Box Drop down - SQL Primary Key filtering

Hi eka,

 

I have 4 combo boxes as seen in attached source2. Each box data comes from a different table (source) from the same SQL database.

 

I want to filter based off the primary keys of the fact tables.

 

For example

see 2 tables below  where plant codes is my primary key in SQL

 

Plant Items             Plant Code                                                        Plant Codes      Description

Steel                            HM                                                                           HM                      Heavy Material

Wood                         LM                                                                             LM                       Light Material

Rubber                      CH                                                                             CH                        Chemicals

Foam                          CH                                   

Detergent               CH

Poly                             HM                   

 

I want to be able to have a combo box for plant codes as the description, which would then filter the next combo box only showing the primary key selected. (ie, if the first combo box selects HM (heavy material) I want the next combo box to only show poly and steel as options)

eka24
Level 10

Re: Combo Box Drop down - SQL Primary Key filtering

You can start watching this cascading dropdown from Shane Young.
https://youtu.be/pkZG2boN7jQ

With the issue of filtering Sql primary key, I will advise you insert another column in your sql table. Then on your form include a number field that would be used for the filtering.
Kindly watch the video first. Also screenshot of your table would give clear view what you have pasted here.


If you like this post, give a thumbs up. Where it solved your issue, Mark as a solution

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 (4,196)