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 Apps Africa Challenge 2022

Power Apps Africa Challenge

Your chance to join an engaging competition of Power Platform enthusiasts.

Super User 2 - 2022 Congratulations

Welcome Super Users

The Super User program for 2022 - Season 2 has kicked off!

September Events 2022

Check out all of these events

Attend in person or online, there are incredible conferences and events happening all throughout the month of September.

Government Carousel

New forum: GCC, GCCH, DoD - Federal App Makers (FAM)

In response to the unique and evolving requirements of the United States public sector, Microsoft has created Power Apps US Government.

Users online (1,937)