cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
cah2035
Helper III
Helper III

Showing records that are NOT related (Many to Many)

Hi all,

 

I have two tables (Table1 and Table2) with many-to-many relationship and am displaying each table as a gallery and have a third gallery showing the records of Table2 that are related to the selected record of Table1. What I want to do is in the gallery of Table2 records, I only want to show the items that are NOT related, so that the user can "move" Table2 records between a "related" gallery and a "not yet related" gallery.

 

Gallery.Selected.Table2 to show related records is easy, but how do I do that opposite?

 

Working with canvas app and Dataverse for Teams as datasource.

1 ACCEPTED SOLUTION

Accepted Solutions
MichelK
Resolver II
Resolver II

Hello @cah2035 ,

 

You could use the following expression:

Filter( Table2, !(ID in Gallery.Selected.Table2.ID) )

ID being the unique identifier of the record. 

Of course this could very easily cause a Delegation problem, so you might need to gather your Table2 records in a collection.

 

Let me know if this helps!

View solution in original post

3 REPLIES 3
MichelK
Resolver II
Resolver II

Hello @cah2035 ,

 

You could use the following expression:

Filter( Table2, !(ID in Gallery.Selected.Table2.ID) )

ID being the unique identifier of the record. 

Of course this could very easily cause a Delegation problem, so you might need to gather your Table2 records in a collection.

 

Let me know if this helps!

@MichelKThank you!

 

It's true that I do get a delegation warning. Since I have using Dataverse as my data source though, and documentation says that Filter and Not are both delegable, I can just ignore that right? It won't matter for this instance anyway since I have only 20 or so records I am filtering, but just wondering.

MichelK
Resolver II
Resolver II

@cah2035 it's true that Filter and Not are both delegable, however the in operator is not.

To work around the matter, there are multiple possibilities depending on your case.
In your case you're right that you don't need to worry about Delegation since you only have 20 records in the table.

 

If you have a specific use case that you need to discuss, I'll be happy to answer any questions.

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

Power Platform Call June 2022 768x460.png

Power Platform Community Call

Join us for the next call on June 15, 2022 at 8am PDT.

PA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

This training provides practical hands-on experience in creating Power Apps solutions in a full-day of instructor-led App creation workshop.

PA.JPG

New Release Planning Portal (Preview)

Check out our new release planning portal, an interactive way to plan and prepare for upcoming features in Power Platform.

Top Solution Authors
Top Kudoed Authors
Users online (1,737)