<p>You can do it like <a href="https://craftcms.stackexchange.com/q/129/125">explained in this answer</a>, only that you also add your dropdown field parameter to your <code>craft.assets</code> criteria model:</p>

<pre><code>{% set assets = craft.assets.docType('A').limit(null) %}
</code></pre>

<p>and then:</p>

<pre><code>{% set entries = craft.entries.section('articles').relatedTo({
    targetElement: assets,
    field: 'documents'
}) %}
</code></pre>

CC BY-SA 3.0
2015-09-04T12:22:17.213Z
Works perfectly! Thx so much :)
migmaker
CC BY-SA 3.0
2015-09-04T06:17:30.043Z
2015-09-04T06:17:30.043Z
2017-04-13T12:51:00.253Z
carlcs
<p>OK so I got entries <code>articles</code> with an asset field <code>documents</code>.<br>
This asset field has an attribute called <code>docType</code> which is a dropdown with 5 values (A, B, C, D, E).  </p>

<p>I d like to select all <code>articles</code> entries that have <code>documents</code> with <code>docType=A</code> criteria.</p>

<p>How can I dot that?<br>
Should I make a <code>relatedTo</code> selection?
I tried multiple things but nothing works.</p>

<entries><elementcriteriamodel>
Select all entries with asset field attribute criteria
# Select all entries with asset field attribute criteria

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

OK so I got entries `articles` with an asset field `documents`.  
This asset field has an attribute called `docType` which is a dropdown with 5 values (A, B, C, D, E).

I d like to select all `articles` entries that have `documents` with `docType=A` criteria.

How can I dot that?  
Should I make a `relatedTo` selection?
I tried multiple things but nothing works.

**Tags:** entries, elementcriteriamodel

---

## 1 answers

### Answer by username_1 on 2015-09-04. Score: 1 | Accepted answer

You can do it like explained in this answer, only that you also add your dropdown field parameter to your craft.assets criteria model:
{% set assets = craft.assets.docType('A').limit(null) %}

and then:
{% set entries = craft.entries.section('articles').relatedTo({
    targetElement: assets,
    field: 'documents'
}) %}

> **Comments:**
> **username_0**: Works perfectly! Thx so much :)  

---

