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

#### Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.