Introduction

The WixDataDistinct methods allow you to refine a distinct query before it runs, as well as sort and limit its results. A distinct query returns unique values for the specified property, without duplicates.

To refine the distinct query, use WixDataDistinct methods in the beforeDistinct() hook. This hook is triggered when you call distinct(), and runs before the distinct query operation executes.

For example, the following hook refines the distinct query by adding an age requirement, and then sorts the results in ascending order:

Copy

You can further refine the distinct query by chaining additional WixDataDistinct methods.

Did this help?