Answers.Body: <p>I'm not sure about an array of the <em>possible</em> values. But you can get the <em>actual</em> values. You can do this with twig's <a href="http://twig.sensiolabs.org/doc/filters/merge.html" rel="nofollow">merge filter</a>. First get all the entries:</p>
  
  <pre><code>{% set allEntries = craft.entries.section('whatever') %}
  </code></pre>
  
  <p>Then loop over the entries and add them to an array:</p>
  
  <pre><code>{% set allValues = [] %}
  
  {% for oneEntry in allEntries %}
    {% if oneEntry.storeBanner not in allValues %}
      {% set allValues = allValues | merge([oneEntry.storeBanner]) %}
    {% endif %}
  {% endfor %}
  </code></pre>
  
  <p>Now <code>allValues</code> will be an array of the values</p>
  
  <p>Things to notice:</p>
  
  <ul>
  <li>You need to set <code>allValues</code> outside of the for-loop. Otherwise it will only exist in the scope of the for loop, and not afterwards - ouside it.</li>
  <li>You need to pass an array as the parameter of <code>merge</code>. In this case an array with one value: <code>[oneEntry.storeBanner]</code></li>
  </ul>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-06-30T17:49:07.820Z
Answers.LastActivityDate: 2015-06-30T17:49:07.820Z
Answers.UserDisplayName: Marion Newlevant
Body: <p>Looking to loop through and filter based on possible values in a text entry field...I have a text field called storeBanner that has 11 possible values (but could have more). Just need a way to go through every entry and create an array with all possible values.</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-30T16:57:29.047Z
Comments.Text: Can you provide more information? What have you tried so far?
Comments.UserDisplayName: Lindsey D
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-06-30T16:59:43.140Z
Comments.Text: Haven't tried anything yet. Not sure how best to go about that
Comments.UserDisplayName: brunam
Tags: <entries>
Title: Is there an easy way to loop through all existing values of an entry field and store them in an array?
ThreadText: # Is there an easy way to loop through all existing values of an entry field and store them in an array?
  
  (Asked by: username_0 on 2015-06-30)
  
  Looking to loop through and filter based on possible values in a text entry field...I have a text field called storeBanner that has 11 possible values (but could have more). Just need a way to go through every entry and create an array with all possible values.
  
  **Tags:** entries
  
  > **Comments:**
  > **username_1**: Can you provide more information? What have you tried so far?  
  > **username_0**: Haven't tried anything yet. Not sure how best to go about that  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2015-06-30. Score: 1
  
  I'm not sure about an array of the *possible* values. But you can get the *actual* values. You can do this with twig's [merge filter](http://twig.sensiolabs.org/doc/filters/merge.html). First get all the entries:
  
  ```
  {% set allEntries = craft.entries.section('whatever') %}
  
  ```
  
  Then loop over the entries and add them to an array:
  
  ```
  {% set allValues = [] %}
  
  {% for oneEntry in allEntries %}
    {% if oneEntry.storeBanner not in allValues %}
      {% set allValues = allValues | merge([oneEntry.storeBanner]) %}
    {% endif %}
  {% endfor %}
  
  ```
  
  Now `allValues` will be an array of the values
  
  Things to notice:
  
  * You need to set `allValues` outside of the for-loop. Otherwise it will only exist in the scope of the for loop, and not afterwards - ouside it.
  * You need to pass an array as the parameter of `merge`. In this case an array with one value: `[oneEntry.storeBanner]`
  
  
  ---
  
  