Answers.Body: <p>Changed this to be :</p>
  
  <pre><code>{% set userBrands = craft.entries.section('brands').relatedTo(currentUser) %}
  {% set fans = craft.users.relatedTo(userBrands) %}
  
  {% for user in fans %}
      &lt;li&gt;{{ user.username }}
  {%  endfor %}
  
  {% endblock %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-13T14:49:31.133Z
Answers.LastActivityDate: 2019-05-13T14:49:31.133Z
Answers.UserDisplayName: JMKelley
Body: <p>I'm looking to show the users that have an entry relating to the <code>currentUser</code>, it is currently working but is obviously showing duplicates e.g. <code>admin, admin</code> as admin has 2x posts associated. Is there a better way of doing this and removing the duplicates? I just can't think of it.</p>
  
  <pre><code>{% set submissions = craft.entries.section('submissions').relatedTo({
    targetElement: currentUser,
    field: 'submissionBrand',
  }) %}
  
  {% for entry in submissions %}
      &lt;li&gt;{{ entry.author.username }}
  {%  endfor %}
  </code></pre>
  
Tags: <templating>
Title: Show Users who have a related entry
ThreadText: # Show Users who have a related entry
  
  (Asked by: username_0 on 2019-05-13)
  
  I'm looking to show the users that have an entry relating to the `currentUser`, it is currently working but is obviously showing duplicates e.g. `admin, admin` as admin has 2x posts associated. Is there a better way of doing this and removing the duplicates? I just can't think of it.
  
  ```
  {% set submissions = craft.entries.section('submissions').relatedTo({
    targetElement: currentUser,
    field: 'submissionBrand',
  }) %}
  
  {% for entry in submissions %}
      <li>{{ entry.author.username }}
  {%  endfor %}
  
  ```
  
  **Tags:** templating
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_0 on 2019-05-13. Score: 1
  
  Changed this to be :
  
  ```
  {% set userBrands = craft.entries.section('brands').relatedTo(currentUser) %}
  {% set fans = craft.users.relatedTo(userBrands) %}
  
  {% for user in fans %}
      <li>{{ user.username }}
  {%  endfor %}
  
  {% endblock %}
  
  ```
  
  
  ---
  
  