Answers.Body: <p>Sounds like your options simply need to be JSON decoded. Unfortunately, Twig doesn't ship with a <code>json_decode</code> filter, so you'll need a plugin – there are <a href="https://straightupcraft.com/craft-plugins?q=json&amp;" rel="nofollow noreferrer">several that fit the bill over at StraightUpCraft</a>.</p>
  
  <p>Using the <a href="https://straightupcraft.com/craft-plugins/json-decode-twig-filter" rel="nofollow noreferrer">JSON Decode Filter</a> plugin, here's how your code would look:</p>
  
  <pre><code>{% set options = entry.optionsAndAccessoiries|json_decode %}
  ...
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2016-12-04T10:10:51.487Z
Answers.LastActivityDate: 2016-12-04T10:10:51.487Z
Answers.UserDisplayName: Mats Mikkel Rummelhoff
Body: <p>With FeedMe I'm importing some data and one of them I get is a complete array that is stored a plain text field.</p>
  
  <p>This array is a bunch of car options what I want to add in a table like this:</p>
  
  <pre><code>{% set options = entry.optionsAndAccessoiries %}
  
  output {{ options }} = ["Achterbank in delen neerklapbaar","Airbag bestuurder","Airconditioning","Anti-slipregeling","Antiblokkeersysteem","Centrale deurvergrendeling afstandbediend","Elektrisch bedienbare ramen voor","Elektrisch verstelbare buitenspiegels","Getint glas","Hoofdsteunen achter","Hoofdsteunen voor","In hoogte verstelbare bestuurdersstoel","Metallic lak","Middenarmsteun voor","Mistlampen voor","Radio\/CD speler","Startonderbreker","Stoelverwarming bestuurder","Stoffen bekleding","Stuurbekrachtiging","Trekhaak","Verstelbaar stuurwiel"]
  
  {% set items = options %}
  
   &lt;table&gt;
    {% for row in items|batch(3, 'No item') %}
    &lt;tr&gt;
      {% for column in row %}
      &lt;td&gt;{{ column }}&lt;/td&gt;
      {% endfor %}
    &lt;/tr&gt;
    {% endfor %}
  &lt;/table&gt;
  </code></pre>
  
  <p>But this is causing an error:</p>
  
  <pre><code>array_chunk() expects parameter 1 to be array, string given
  </code></pre>
  
  <p>Who can help me out to point me in the right direction?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-04T02:15:51.317Z
Comments.Text: When you `{{ options }}` you literally get the output that you displayed above?  i.e. square brackets and everything?
Comments.UserDisplayName: Brad Bell
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-04T09:16:38.933Z
Comments.Text: Yes correct. And when I copy/paste that to `{% set options = ["Achterbank in delen neerklapbaar","Airbag bestuurder","etc..."]` it works like a charm.
Comments.UserDisplayName: John Stevens
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-04T09:43:29.590Z
Comments.Text: This is not working:
  `{% set opties = ["Achterbank in delen neerklapbaar","Airbag bestuurder","Airconditioning"] %}
  
                       {% set items = opties %}
  
                      <table>
                      {% for row in items|batch(3, 'No item') %}
                          <tr>
                              {% for column in row %}
                                  <td>{{ column }}</td>
                              {% endfor %}
                          </tr>
                      {% endfor %}
                      </table>`
Comments.UserDisplayName: John Stevens
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2016-12-04T09:45:52.367Z
Comments.Text: While this is working:
  `{% set items = ["Achterbank in delen neerklapbaar","Airbag bestuurder","Airconditioning"] %}
  
                      <table>
                      {% for row in items|batch(3, 'No item') %}
                          <tr>
                              {% for column in row %}
                                  <td>{{ column }}</td>
                              {% endfor %}
                          </tr>
                      {% endfor %}
                      </table>`
Comments.UserDisplayName: John Stevens
Tags: <entrymodel><array><plugin-feedme>
Title: How to convert this 'array'
ThreadText: # How to convert this 'array'
  
  (Asked by: username_0 on 2016-12-04)
  
  With FeedMe I'm importing some data and one of them I get is a complete array that is stored a plain text field.
  
  This array is a bunch of car options what I want to add in a table like this:
  
  ```
  {% set options = entry.optionsAndAccessoiries %}
  
  output {{ options }} = ["Achterbank in delen neerklapbaar","Airbag bestuurder","Airconditioning","Anti-slipregeling","Antiblokkeersysteem","Centrale deurvergrendeling afstandbediend","Elektrisch bedienbare ramen voor","Elektrisch verstelbare buitenspiegels","Getint glas","Hoofdsteunen achter","Hoofdsteunen voor","In hoogte verstelbare bestuurdersstoel","Metallic lak","Middenarmsteun voor","Mistlampen voor","Radio\/CD speler","Startonderbreker","Stoelverwarming bestuurder","Stoffen bekleding","Stuurbekrachtiging","Trekhaak","Verstelbaar stuurwiel"]
  
  {% set items = options %}
  
   <table>
    {% for row in items|batch(3, 'No item') %}
    <tr>
      {% for column in row %}
      <td>{{ column }}</td>
      {% endfor %}
    </tr>
    {% endfor %}
  </table>
  
  ```
  
  But this is causing an error:
  
  ```
  array_chunk() expects parameter 1 to be array, string given
  
  ```
  
  Who can help me out to point me in the right direction?
  
  **Tags:** entrymodel, array, plugin-feedme
  
  > **Comments:**
  > **username_1**: When you `{{ options }}` you literally get the output that you displayed above?  i.e. square brackets and everything?  
  > **username_0**: Yes correct. And when I copy/paste that to `{% set options = ["Achterbank in delen neerklapbaar","Airbag bestuurder","etc..."]` it works like a charm.  
  > **username_0**: This is not working: `{% set opties = ["Achterbank in delen neerklapbaar","Airbag bestuurder","Airconditioning"] %}                       {% set items = opties %}                      <table>                     {% for row in items|batch(3, 'No item') %}                         <tr>                             {% for column in row %}                                 <td>{{ column }}</td>                             {% endfor %}                         </tr>                     {% endfor %}                     </table>`  
  > **username_0**: While this is working: `{% set items = ["Achterbank in delen neerklapbaar","Airbag bestuurder","Airconditioning"] %}                      <table>                     {% for row in items|batch(3, 'No item') %}                         <tr>                             {% for column in row %}                                 <td>{{ column }}</td>                             {% endfor %}                         </tr>                     {% endfor %}                     </table>`  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2016-12-04. Score: 2 | Accepted answer
  
  Sounds like your options simply need to be JSON decoded. Unfortunately, Twig doesn't ship with a `json_decode` filter, so you'll need a plugin – there are [several that fit the bill over at StraightUpCraft](https://straightupcraft.com/craft-plugins?q=json&).
  
  Using the [JSON Decode Filter](https://straightupcraft.com/craft-plugins/json-decode-twig-filter) plugin, here's how your code would look:
  
  ```
  {% set options = entry.optionsAndAccessoiries|json_decode %}
  ...
  
  ```
  
  
  ---
  
  