# Ability to query customers Delivery Area using BrewwQL

**URL:** <https://community.breww.com/t/ability-to-query-customers-delivery-area-using-brewwql/2672>\
**Category:** Ideas & feature requests\
**Tags:** idea-completed\
**Created:** [20 June 2023 15:11 UTC](https://community.breww.com/t/ability-to-query-customers-delivery-area-using-brewwql/2672 "2023-06-20T15:11:55Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![michael-gill](https://community.breww.com/user_avatar/community.breww.com/michael-gill/32/1741_2.png) [@michael-gill](https://community.breww.com/u/michael-gill)\
**Post date:** [20 June 2023 15:11 UTC](https://community.breww.com/t/ability-to-query-customers-delivery-area-using-brewwql/2672/1 "2023-06-20T15:11:55Z")

</div>

Hi,  
It would be useful to be able to query the delivery area a customer is in using BrewwQL.

Currently, as a workaround, we assign the relevant static delivery area tag to each customer. But this is time-consuming, prone to mistakes, and is difficult to scale.

Thanks

---

<div class="post-metadata">

**Author:** ![luke](https://community.breww.com/user_avatar/community.breww.com/luke/32/3636_2.png) [@luke](https://community.breww.com/u/luke)\
**Post date:** [20 June 2023 15:34 UTC](https://community.breww.com/t/ability-to-query-customers-delivery-area-using-brewwql/2672/2 "2023-06-20T15:34:37Z")

</div>

Thanks for the suggestion, Michael. I can see how this would be useful.

The difficulty here (and why this isn’t already an option) is that a customer can fit into multiple delivery areas (you can draw overlapping areas). There might well be a good solution to this that we can implement, but I wanted to give you some background on why this is not there already 👍

---

<div class="post-metadata">

**Author:** ![craig-edmunds](https://community.breww.com/user_avatar/community.breww.com/craig-edmunds/32/822_2.png) [@craig-edmunds](https://community.breww.com/u/craig-edmunds)\
**Post date:** [25 October 2023 06:02 UTC](https://community.breww.com/t/ability-to-query-customers-delivery-area-using-brewwql/2672/3 "2023-10-25T06:02:05Z")

</div>

Treating it similar to a tag with the same query operators would be fine wouldn’t ir @luke ?

---

<div class="post-metadata">

**Author:** ![luke](https://community.breww.com/user_avatar/community.breww.com/luke/32/3636_2.png) [@luke](https://community.breww.com/u/luke)\
**Post date:** [25 October 2023 08:20 UTC](https://community.breww.com/t/ability-to-query-customers-delivery-area-using-brewwql/2672/4 "2023-10-25T08:20:14Z")

</div>

It’s not as simple as it sounds as we also never store that a customer is part of a delivery area and for performance reasons BrewwQL filters can only interact with “stored” data.

Currently, each time we need to know if a customer is in a delivery area, we work it out at the time. Doing this for all customers on all queries would be too slow.

So yes, we could use a similar approach as we have with tags, but we’d first need to start to store which customers were in which areas and ensure that every time a customer’s address was updated we checked all delivery areas, and every time a delivery area was updated we checked all customer accounts to see if they matched the new area.

All of this means that what feels like a simple request on the surface is actually far more substantial than it looks. Keep the votes coming though and let’s get it moved up the priority list 👍

---

<div class="post-metadata">

**Author:** ![matt-cousins](https://community.breww.com/user_avatar/community.breww.com/matt-cousins/32/3876_2.png) [@matt-cousins](https://community.breww.com/u/matt-cousins)\
**Post date:** [16 April 2024 07:29 UTC](https://community.breww.com/t/ability-to-query-customers-delivery-area-using-brewwql/2672/7 "2024-04-16T07:29:41Z")

</div>

Great news! Delivery Area is now available for use with BrewwQL. It can be used in filters and also as a field to view in reporting.

@craig-edmunds, I have also exposed the field in the customers-suppliers endpoint in the API.

We hope this helps!

---

<div class="post-metadata">

**Author:** ![matt-cousins](https://community.breww.com/user_avatar/community.breww.com/matt-cousins/32/3876_2.png) [@matt-cousins](https://community.breww.com/u/matt-cousins)\
**Post date:** [22 April 2024 07:00 UTC](https://community.breww.com/t/ability-to-query-customers-delivery-area-using-brewwql/2672/8 "2024-04-22T07:00:15Z")

</div>

This topic was automatically closed after 5 days. New replies are no longer allowed.
