<p><code>$element-&gt;getFieldValue('handle')</code> or it's Twig equivalent <code>element.handle</code> contains an Object of type <code>MultiOptionsFieldData</code> you can get all possible values via it<code>s</code>getOptions()` function</p>

<h3>Twig</h3>

<pre><code>{{ dump(entry.fieldHandle.getOptions()) }}
</code></pre>

<h3>PHP</h3>

<pre><code>$options = $element-&gt;getFieldValue('handle')-&gt;getOptions();
</code></pre>

CC BY-SA 4.0
2018-08-01T07:19:59.973Z
2018-08-01T07:19:59.973Z
Robin Schambach
<p>I have a multi-select field in my work section</p>

<p><a href="https://i.sstatic.net/8iCW6.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/8iCW6.png" alt="enter image description here"></a></p>

<p>I want to get the values either with the Element api as json or an array of simple values in my template. </p>

CC BY-SA 4.0
2018-07-31T23:28:16.463Z
Do you want every possible value for the field? Or all of the selected values for the field on an element (i.e. entry, user, etc.).
Brad Bell
CC BY-SA 4.0
2018-08-01T04:35:26.990Z
Hi Brad, every value.
LeBlaireau
<templating><field><plugin-elementapi><json>
Getting all the values out of a field as array of values
# Getting all the values out of a field as array of values

(Asked by: username_0 on 2018-07-31)

I have a multi-select field in my work section

[![enter image description here](https://i.sstatic.net/8iCW6.png)](https://i.sstatic.net/8iCW6.png)

I want to get the values either with the Element api as json or an array of simple values in my template.

**Tags:** templating, field, plugin-elementapi, json
> **Comments:**
> **username_1**: Do you want every possible value for the field? Or all of the selected values for the field on an element (i.e. entry, user, etc.).  
> **username_0**: Hi Brad, every value.  

---

## 1 answers

### Answer by username_2 on 2018-08-01. Score: 1

$element->getFieldValue('handle') or it's Twig equivalent element.handle contains an Object of type MultiOptionsFieldData you can get all possible values via itsgetOptions()` function
Twig
{{ dump(entry.fieldHandle.getOptions()) }}

PHP
$options = $element->getFieldValue('handle')->getOptions();


---

