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
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Difinity Conference 2022

Difinity Conference 2022

Register today for two amazing days of learning, featuring intensive learning sessions across multiple tracks, led by engaging and dynamic experts.

European SharePoint Conference

European SharePoint Conference

The European SharePoint Conference returns live and in-person November 28-December 1 with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Power Apps Ideas

Changes to Ideas Coming

We are excited to announce a new way to share your ideas for Power Apps!

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