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

Data Table Filter with Combo Box

My problem seems to be simple.

 

One combo box, one data table, two SQL table data sources. 

 

The table attached to the combo box is used to search by name and grab the ID datafield attached to it. 

The ID has a 1-to-M relationship with the ID in the other SQL table so that's what is used to filter the table. 


The filtered table should only show the rows that match the ID in the combo box. 

 

What is the proper Filter syntax? Cause nothing I've tried worked. 

I have attached a screenshot of the canvas header, the rest is just the table

1 ACCEPTED SOLUTION

Accepted Solutions
v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Do you mean that:

1)there are two sql tables, their relationship is 1:M based on ID field

2)combo box is used to display sql table1(1)

3)data table is used to display sql table2(M)

4)filter data table based on the selection of combo box?
Could you tell me whether that combo box allows multiple selections?

1)If yes, try to set like this:

combo box's Items:

sqltable1

data table's Items:

If(IsEmpty(comboboxname.Selected),sqltable2,
Filter(sqltable2,ID=comboboxname.Selected.ID)
)

 

2)If no, try to set like this:

combo box's Items:

 

sqltable1

 

data table's Items:

 

If(IsEmpty(comboboxname.Selected),sqltable2,
Filter(sqltable2,ID in comboboxname.SelectedItems.ID)
)

 

 

 

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.

View solution in original post

2 REPLIES 2
v-yutliu-msft
Community Support
Community Support

Hi @Anonymous ,

Do you mean that:

1)there are two sql tables, their relationship is 1:M based on ID field

2)combo box is used to display sql table1(1)

3)data table is used to display sql table2(M)

4)filter data table based on the selection of combo box?
Could you tell me whether that combo box allows multiple selections?

1)If yes, try to set like this:

combo box's Items:

sqltable1

data table's Items:

If(IsEmpty(comboboxname.Selected),sqltable2,
Filter(sqltable2,ID=comboboxname.Selected.ID)
)

 

2)If no, try to set like this:

combo box's Items:

 

sqltable1

 

data table's Items:

 

If(IsEmpty(comboboxname.Selected),sqltable2,
Filter(sqltable2,ID in comboboxname.SelectedItems.ID)
)

 

 

 

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.

View solution in original post

Anonymous
Not applicable

The First option worked perfectly. Thank you so much!

Helpful resources

Announcements
User Groups Public Preview

Join us for our User Group Public Preview!

Power Apps User Groups are coming! Make sure you’re among the first to know when user groups go live for public preview.

Power Apps Community Call

Monthly Power Apps Community Call

Did you miss the call?? Check out the Power Apps Community Call here!

Power Platform ISV STudio

Power Platform ISV Studio

ISV Studio is the go-to Power Platform destination for ISV’s to monitor & manage applications post-AppSource publish.

Top Solution Authors
Top Kudoed Authors
Users online (43,494)