<p>Something like this should do it:</p>

<pre><code>{% set entries = craft.entries.section('news').relatedTo({
    targetElement: currentUser,
    field: 'customUserField'
}).find() %}
</code></pre>

<p>More on the relatedTo method here: <a href="https://craftcms.com/docs/relations" rel="nofollow">https://craftcms.com/docs/relations</a></p>

CC BY-SA 3.0
2016-04-07T00:17:56.827Z
2016-04-07T00:17:56.827Z
Brad Bell
<p>There is a set of entries:</p>

<pre><code>{% set entries = craft.entries.section('news') %}
</code></pre>

<p>Each entry has a custom field <code>customUserField</code>.  <code>customUserField</code> this is a field Users. How do you fetch entries where <code>customUserField</code> === <code>currentUser</code>?</p>

<users><elementcriteriamodel>
Get entries by custom Users field value
# Get entries by custom Users field value

(Asked by: username_0 on 2016-04-06)

There is a set of entries:
{% set entries = craft.entries.section('news') %}

Each entry has a custom field customUserField.  customUserField this is a field Users. How do you fetch entries where customUserField === currentUser?

**Tags:** users, elementcriteriamodel


---

## 1 answers

### Answer by username_1 on 2016-04-07. Score: 3 | Accepted answer

Something like this should do it:
{% set entries = craft.entries.section('news').relatedTo({
    targetElement: currentUser,
    field: 'customUserField'
}).find() %}

More on the relatedTo method here: https://craftcms.com/docs/relations


---

