<p>I asked this on the Slack chat and Brad Bell kindly came to the rescue.</p>

<hr>

<pre><code>{% set match = false %}

{% for user in entry.users %}
    {% if user.username == currentUser.username %}
        {% set match = true %}
    {% endif %} 
{% endfor %}

{% if match %}
    User matches!
{% endif %}
</code></pre>

CC BY-SA 3.0
2015-04-16T02:47:52.263Z
2015-04-16T03:35:47.233Z
2015-04-16T03:35:47.233Z
Chase Giunta
<p>I've already found the entry, and the 'users' field can contain multiple users.</p>

<entries><users>
How to check if currentUser matches a users field within an entry?
# How to check if currentUser matches a users field within an entry?

(Asked by: username_0 on 2015-04-16)

I've already found the entry, and the 'users' field can contain multiple users.

**Tags:** entries, users

---

## 1 answers

### Answer by username_0 on 2015-04-16. Score: 2 | Accepted answer

I asked this on the Slack chat and Brad Bell kindly came to the rescue.

{% set match = false %}

{% for user in entry.users %}
    {% if user.username == currentUser.username %}
        {% set match = true %}
    {% endif %} 
{% endfor %}

{% if match %}
    User matches!
{% endif %}


---

