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

Filter Related Table

I have two SQL tables, linked in a one-to-many relationship.

   

    Table 1 is 'Teams.'  The primary key is "ID," an integer.

    Table 2 is 'Members.'  The join field is "EntityID," also an integer.

 

I use a ComboBox to look up a particular "Team."  A FormViewer on the screen shows various details about the "Team."  I have included a datacard (DataCard20) which correctly displays the selected "Team" ID.

 

I want to display "Members" (in a table format) who are associated with the selected Team on the same screen.

 

I can hard code the filter and get expected results.  For example,

       Filter('[dbo].[Members]', EntityID = 1731), where '1731' is an actual "ID" from Teams.

 

However, my attempts at creating a filtering formula fail or generate warnings.  Here are some of my attempts:

 

Filter('[dbo].[Members]', EntityID = DataCardValue25)       (Errors with invalid argument)

Filter('[dbo].[members]', DataCardValue25 = Entity)           (Delegation Warning)

 

For the time being, I can live with the delegation warning, but my table is near 2000 records and growing.

 

I have used both a DataTable and a Gallery to display the "Member" table.  The resutls for each method are the same.

 

I would appreciate some guidance.

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Filter Related Table

Hi @Bubba,

How do you list the ID values from your 'Teams' Table? Using Combo Box control?

Is the DataCardValue25 a Combo Box control within your Edit form?

Could you please share more details about the formula you provided within the Items property of the DataCardValue25 (a Combo Box control)?

Based on the formula that you provided, I think there is something wrong with it.

I have made a test on my side, and don't have the issue that you mentioned. Please take a try with the following workaround:7.JPG

 

8.JPG

Set the Items property of the Combo Box control (ComboBox1) to following:

 

'[dbo].[Teams]'

 

Set the Items property of the Data Table control to following:

 

Filter('[dbo].[Members]',EntityID = ComboBox1.Selected.Id)

On your side, you should type:

 

Filter('[dbo].[Members]',EntityID = DataCardValue25.Selected.ID)

Or

Filter('[dbo].[Members]',EntityID = DataCardValue25.Selected.Value)

The GIF screenshot as below:Test1.gif

Note: The data structure of my 'Teams' table and 'Members' table as below:9.JPG

 

10.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
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
Community Support Team
Community Support Team

Re: Filter Related Table

Hi @Bubba,

How do you list the ID values from your 'Teams' Table? Using Combo Box control?

Is the DataCardValue25 a Combo Box control within your Edit form?

Could you please share more details about the formula you provided within the Items property of the DataCardValue25 (a Combo Box control)?

Based on the formula that you provided, I think there is something wrong with it.

I have made a test on my side, and don't have the issue that you mentioned. Please take a try with the following workaround:7.JPG

 

8.JPG

Set the Items property of the Combo Box control (ComboBox1) to following:

 

'[dbo].[Teams]'

 

Set the Items property of the Data Table control to following:

 

Filter('[dbo].[Members]',EntityID = ComboBox1.Selected.Id)

On your side, you should type:

 

Filter('[dbo].[Members]',EntityID = DataCardValue25.Selected.ID)

Or

Filter('[dbo].[Members]',EntityID = DataCardValue25.Selected.Value)

The GIF screenshot as below:Test1.gif

Note: The data structure of my 'Teams' table and 'Members' table as below:9.JPG

 

10.JPG

 

 

Best regards,

Kris

Community Support Team _ Kris Dai
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

Bubba
Level: Powered On

Re: Filter Related Table

Thank you.

 

I set the Items property of the data table to the following:

 

     Filter('[dbo].[Members]',EntityID = ComboBox1.Selected.Id)

 

(DataCardValue25 was a text control that I was attempting to use to generate the Team ID) 

Helpful resources

Announcements
thirdimage

Power Automate 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

fifthimage

Microsoft Learn

Learn how to build the business apps that you need.

Top Kudoed Authors
Users Online
Currently online: 217 members 5,000 guests
Please welcome our newest community members: