<p>Yep! It's not <em>super</em> well documented, but there's a little information about it down in the <a href="https://craftcms.com/docs/3.x/element-queries.html#advanced-element-queries" rel="nofollow noreferrer">Advanced Element Queries</a> section of the docs. It would look something like:</p>
<pre><code>  {% set titleList = craft.entries.section('articles').select('title').column() %}
</code></pre>
<p>One thing to note, if you're selecting a field value instead of the title, the <code>select</code> parameter will look something like <code>select('field_fieldHandle')</code></p>

CC BY-SA 4.0
2020-10-18T19:38:01.143Z
You answered my question exactly, but in case anyone is interested in an after-the-query way to dice up their objects, the `column` filter seems like a great option because you can even pass a function for extra logic. https://craftcms.com/docs/3.x/dev/filters.html#column
Brimby
CC BY-SA 4.0
2020-10-13T01:48:57.120Z
2020-10-13T01:48:57.120Z
brianjhanson
<p>For instance, if I wanted an array of all the titles belonging to a subset of entries that I wish to query. The way I know how to do this currently is like so:</p>
<pre><code>  {% set titleList = [] %}
  {% articleQuery = craft.entries().section('articles') %}
  {% for article in articleQuery.all() %}
    {% set titleList = titleList|merge([article.title]) %}
  {% endfor %}
</code></pre>
<p>The other way I can think of to do this operation is with the <code>map</code> twig filter, but I'm wondering if there is a way to query for such a field-value list straight away and avoid spending computational time on iterations.</p>

<templating><query><elementquery>
Is there a way to query for a list of values belonging to a specific field in a queryset?
# Is there a way to query for a list of values belonging to a specific field in a queryset?

(Asked by: username_0 on 2020-10-12)

For instance, if I wanted an array of all the titles belonging to a subset of entries that I wish to query. The way I know how to do this currently is like so:
  {% set titleList = [] %}
  {% articleQuery = craft.entries().section('articles') %}
  {% for article in articleQuery.all() %}
    {% set titleList = titleList|merge([article.title]) %}
  {% endfor %}

The other way I can think of to do this operation is with the map twig filter, but I'm wondering if there is a way to query for such a field-value list straight away and avoid spending computational time on iterations.

**Tags:** templating, query, elementquery

---

## 1 answers

### Answer by username_1 on 2020-10-13. Score: 3 | Accepted answer

Yep! It's not super well documented, but there's a little information about it down in the Advanced Element Queries section of the docs. It would look something like:
  {% set titleList = craft.entries.section('articles').select('title').column() %}

One thing to note, if you're selecting a field value instead of the title, the select parameter will look something like select('field_fieldHandle')

> **Comments:**
> **username_0**: You answered my question exactly, but in case anyone is interested in an after-the-query way to dice up their objects, the `column` filter seems like a great option because you can even pass a function for extra logic. https://craftcms.com/docs/3.x/dev/filters.html#column  

---

