cancel
Showing results for
Did you mean:
Helper III

## Filtering records that are NOT in another table and showing in gallery

Need a bit of help here.  I have a gallery that displays some master records, say like Customers.  The user can click on a customer record and it will bring up any orders for that customer and those are listed in a second gallery.  I have a third gallery that needs to display items that the customer did NOT order.  So say the customer is #100.  They two orders, 1001, 1002.  The inventory list is A, B, C, D, E.  For order 1001 they ordered items A, C, E.  For order 1002 they ordered A, B, C, D and E.  So what I need is this third gallery to show items B and D if the first order (1001) is selected.  If order 1002 is selected then it would not display any records because all five items are in the order.  Hope this makes some sense.  That third gallery is meant to show exceptions so if it's items are missing from another table (the order table) then they will be listed.

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
Super User

With the proviso that the table in question does not contain more than 2k items, (under the delegation limit), you can do something like this:

With(
{finv: ItemsPropertyfrom Gallery2},
Filter(
InventoryList, !(ID in finv.ID)
)
)

The With() formula creates a table that is the same as your gallery2 and then filters the inventory list against the Items that have been previously selected.  Because the "Not" and "in" operators are used in this formula, delegation limits will apply so your inventory list cannot exceed 2k items.

2 REPLIES 2
Super User

With the proviso that the table in question does not contain more than 2k items, (under the delegation limit), you can do something like this:

With(
{finv: ItemsPropertyfrom Gallery2},
Filter(
InventoryList, !(ID in finv.ID)
)
)

The With() formula creates a table that is the same as your gallery2 and then filters the inventory list against the Items that have been previously selected.  Because the "Not" and "in" operators are used in this formula, delegation limits will apply so your inventory list cannot exceed 2k items.

Helper III

And yes, the table would contain under 2K.  And thanks for this information!

Announcements

#### 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

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

#### 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.

#### 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 (3,442)