<p>You’re just missing the <code>:</code> at the end of <code>:notempty:</code> in your second example. This will work:</p>

<pre><code>{% set params = { section: 'sectionName', customField: ':notempty:', limit: 10} %}
</code></pre>

CC BY-SA 3.0
2015-10-09T08:40:04.820Z
Thank you. Is there any documentation on this? Similar example here: http://craftcms.stackexchange.com/questions/452/return-entries-where-field-is-not-empty
Clive Portman
CC BY-SA 3.0
2015-10-08T18:22:05.800Z
2015-10-08T18:22:05.800Z
Brandon Kelly
<p>The following returns entries correctly:</p>

<pre><code>{% paginate craft.entries.section('sectionName').customField(':notempty:').limit(10) as products %}
    {% for product in products %}
        {% include 'incs/_productSnippet' %}
    {% endfor %}
{% endpaginate %}
</code></pre>

<p>But the following returns empty:</p>

<pre><code>{% set params = { section: 'sectionName', customField: ':notempty', limit: 10} %}
{% paginate craft.entries(params) as products %}
    {% for product in products %}
        {% include 'incs/_productSnippet' %}
    {% endfor %}
{% endpaginate %}
</code></pre>

<p>It's the latter I'm after because the customField I want to check varies. Removing the <code>customField: ':notempty',</code> from <code>params</code> in the second example returns entries, so I'm guessing it's the way I'm using customField within <code>params</code>?</p>

CC BY-SA 3.0
2015-10-08T15:39:48.967Z
Seems you're missing the closing colon `:notempty:` in the 2nd example.
Brad Bell
<entries><custom-field><params>
How to check custom field not empty within params?
# How to check custom field not empty within params?

(Asked by: username_0 on 2015-10-08)

The following returns entries correctly:
{% paginate craft.entries.section('sectionName').customField(':notempty:').limit(10) as products %}
    {% for product in products %}
        {% include 'incs/_productSnippet' %}
    {% endfor %}
{% endpaginate %}

But the following returns empty:
{% set params = { section: 'sectionName', customField: ':notempty', limit: 10} %}
{% paginate craft.entries(params) as products %}
    {% for product in products %}
        {% include 'incs/_productSnippet' %}
    {% endfor %}
{% endpaginate %}

It's the latter I'm after because the customField I want to check varies. Removing the customField: ':notempty', from params in the second example returns entries, so I'm guessing it's the way I'm using customField within params?

**Tags:** entries, custom-field, params
> **Comments:**
> **username_1**: Seems you're missing the closing colon `:notempty:` in the 2nd example.  

---

## 1 answers

### Answer by username_2 on 2015-10-08. Score: 3 | Accepted answer

You’re just missing the : at the end of :notempty: in your second example. This will work:
{% set params = { section: 'sectionName', customField: ':notempty:', limit: 10} %}

> **Comments:**
> **username_0**: Thank you. Is there any documentation on this? Similar example here: http://craftcms.stackexchange.com/questions/452/return-entries-where-field-is-not-empty  

---

