cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
evalindag
Helper II
Helper II

Filtering a datatable by other datatable with different datasources

Hi everybody

 

I'm trying to filter a datatable by the line chosen in an above datatable. The datatables have different sources but are connected via GroupID. I've added two screenshots of the Power App. 

I want to be able to choose, for example the bottom row in the top table and get all the items that have the same group ID in the bottom table. 

I've tried the following formula: Filter(StarirBookingsV2S, Group = DataTable2.Selected.GroupId) but I get a delegation error. "Delegation warning. The highlighted part of this formula might not work correctly with the column "Group" on large data sets"  

 

Can anybody here help me with this problem I am facing?

 

Best regards

Eva

 

Datatables.pngdatatables2.png

1 ACCEPTED SOLUTION

Accepted Solutions

Hi @evalindag ,

Absolutely - you cannot filter on Lookup columns. I cannot test this, but try

With(
   {wId:DataTable2.Selected.GroupId},
   Filter(
      AddColumns(
         StarirBookingsV2S,
         "vGroup",
         Group.Value
      ),			   
      vGroup = wId
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

6 REPLIES 6
WarrenBelz
Super User III
Super User III

Hi @evalindag ,

Try this

With(
   {wGroup:DataTable2.Selected.GroupId},
   Filter(
      StarirBookingsV2S, 
      Group = wGroup
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

Hi @WarrenBelz and thank you for your reply, however I also get the delegation warning while using this formula as you can see in the screenshot

 

2020-09-01_09-20-11.png

 

Best regards

Eva

Thanks @evalindag ,

I thought that would work. What type of field is Group?

@WarrenBelz  It's a Lookup datatype. It gets its value from another entity in CDS through a relationship. Could that be the problem? There is another field called Group ID (Whole number) and has the same value but if I put that instead of Group in the formula it gives me an incompatible type error 

 

2020-09-01_09-48-46.png

2020-09-01_09-52-42.png

 

Best, 

Eva

Hi @evalindag ,

Absolutely - you cannot filter on Lookup columns. I cannot test this, but try

With(
   {wId:DataTable2.Selected.GroupId},
   Filter(
      AddColumns(
         StarirBookingsV2S,
         "vGroup",
         Group.Value
      ),			   
      vGroup = wId
   )
)

 

Please click Accept as solution if my post helped you solve your issue. This will help others find it more readily. It also closes the item. If the content was useful in other ways, please consider giving it Thumbs Up.

View solution in original post

Hi @WarrenBelz thank you so so so much, this one worked! 🙂 

 

Best regards

Eva

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (23,547)