# Where OR function

**URL:** <https://discourse.gohugo.io/t/where-or-function/8905>\
**Category:** support\
**Created:** [October 23, 2017, 11:16pm UTC](https://discourse.gohugo.io/t/where-or-function/8905 "2017-10-23T23:16:23Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![willwade](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/willwade/32/2098_2.png) [@willwade](https://discourse.gohugo.io/u/willwade)\
**Post date:** [October 23, 2017, 11:16pm UTC](https://discourse.gohugo.io/t/where-or-function/8905/1 "2017-10-23T23:16:23Z")

</div>

I’m trying to use where with an OR - is this possible??

e.g.

```
{{ range where .Data.Pages ".Params.moderated" "==" true OR ".Params.moderated" "==" nil }}

```

(i.e all pages where there is a params.moderated = true OR it isn’t set at all)

Obviously thats not working so how do I do this??

Thanks

---

<div class="post-metadata">

**Author:** ![budparr](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/budparr/32/749_2.png) [@budparr](https://discourse.gohugo.io/u/budparr)\
**Post date:** [October 24, 2017, 12:31am UTC](https://discourse.gohugo.io/t/where-or-function/8905/2 "2017-10-24T00:31:17Z")

</div>

Maybe check out the `union` function. [https://gohugo.io/functions/union#readout](https://gohugo.io/functions/union#readout)

See if this is similar to what you’re looking for: [Trying to list sections and pages based on content and page params](https://discourse.gohugo.io/t/trying-to-list-sections-and-pages-based-on-content-and-page-params/8868)

---

<div class="post-metadata">

**Author:** ![willwade](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.gohugo.io/willwade/32/2098_2.png) [@willwade](https://discourse.gohugo.io/u/willwade)\
**Post date:** [October 24, 2017, 6:53am UTC](https://discourse.gohugo.io/t/where-or-function/8905/3 "2017-10-24T06:53:20Z")

</div>

Awesome. Thanks

For the record I did it like this:

```
    {{$a := where .Data.Pages ".Params.moderated" "==" true}}
{{$b := where .Data.Pages "Section" "post"}}
{{$c := $a | union $b }}
    {{ range $c }}
```
