Answers.Body: <p>Custom field data is accessible via <code>currentUser.getContent()</code>.</p>
  
  <p>Using <code>dump</code>:</p>
  
  <pre><code>{{ dump(currentUser.getContent()) }}
  </code></pre>
  
  <p>Or to output as string:</p>
  
  <pre><code>{{ currentUser.getContent()|join(', ') }}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-23T11:18:30.390Z
Answers.Text: Cheers dump brings back the object. But the output as string fails with 'Array to string conversion' error. I've also tried:
  
  [code]{% set profile = currentUser.getContent() %}
  
  {% for key, value in profile %}
    {{ value }}
    {{ key }}
  {% endfor %}
Answers.UserDisplayName: Lettie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-23T16:15:26.833Z
Answers.Text: Hmm... 'join' works fine for me on my test DB. Maybe one of the fields is being returned as an array. Possibly a matrix or table field?
Answers.UserDisplayName: Douglas McDonald
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-28T09:25:53.890Z
Answers.Text: yep that is exactly what was happening. I added a check to see if any returned data was also an array and it now works fine. Thanks
Answers.UserDisplayName: Lettie
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-04-22T18:22:51.327Z
Answers.LastActivityDate: 2015-04-22T18:22:51.327Z
Answers.UserDisplayName: Douglas McDonald
Body: <p>Hi I'm sure this is simple but it is eluding me. I want to pull out all the user profile fields with twig as an array that I can then check. When I dump the user or currentUser data it does not show any of the profile fields I have created in the returned object. I can however still access these fields with user.customfieldname. How can I return the array I am looking for?</p>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2015-04-22T18:23:56.750Z
Comments.Text: You might want to check out a plugin called inspector, which outputs all methods, attributes, etc, all nicely formatted. `{{ currentUser.getContent()|inspect }}`
Comments.UserDisplayName: Douglas McDonald
Tags: <templating><user-profile><usermodel>
Title: How can I return all user custom profile fields in an array?
ThreadText: # How can I return all user custom profile fields in an array?
  
  (Asked by: username_0 on 2015-04-22)
  
  Hi I'm sure this is simple but it is eluding me. I want to pull out all the user profile fields with twig as an array that I can then check. When I dump the user or currentUser data it does not show any of the profile fields I have created in the returned object. I can however still access these fields with user.customfieldname. How can I return the array I am looking for?
  
  **Tags:** templating, user-profile, usermodel
  
  > **Comments:**
  > **username_1**: You might want to check out a plugin called inspector, which outputs all methods, attributes, etc, all nicely formatted. `{{ currentUser.getContent()|inspect }}`  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-04-22. Score: 2 | Accepted answer
  
  Custom field data is accessible via `currentUser.getContent()`.
  
  Using `dump`:
  
  ```
  {{ dump(currentUser.getContent()) }}
  
  ```
  
  Or to output as string:
  
  ```
  {{ currentUser.getContent()|join(', ') }}
  
  ```
  
  > **Comments:**
  > **username_0**: Cheers dump brings back the object. But the output as string fails with 'Array to string conversion' error. I've also tried:  [code]{% set profile = currentUser.getContent() %}  {% for key, value in profile %}   {{ value }}   {{ key }} {% endfor %}  
  > **username_1**: Hmm... 'join' works fine for me on my test DB. Maybe one of the fields is being returned as an array. Possibly a matrix or table field?  
  > **username_0**: yep that is exactly what was happening. I added a check to see if any returned data was also an array and it now works fine. Thanks  
  
  ---
  
  