On a recent implementation, a large site fully driven by OData, we ran into a scenario where we wanted to retrieve DCPs based on multiple custom metadata values. We quickly realized that there are some limitations around this. For instance: a component with the following custom meta fields, color and shape, having values ‘blue’ and ‘round’ respectively cannot be retrieved in one OData call. This is because each CustomMetas Key/Value is exposed as a separate entry in the CustomMetas collection, and the OData protocol is limited – doesn’t allow querying across properties of multiple entries (not as an AND at least). However, if there is a will there is a way, and in the article I will show an approach to doing so.
- Part 1 – Examining the Problem
- Part 2 – The Generic Workaround
- Part 3 – The Multi-Meta Query Solution