Answers.Body: <p>You need to exclude the ids from the beginning.</p>
  
  <pre><code>{% set excludeIds = currentUser.completed.ids() %}
  {% set entry = craft
      .entries
      .section([
          'getStarted',
          'rollOut',
          'assessAndPrioritize',
          'agreeCommit',
          'measureSuccess'
      ])
      .order({stepNumber: SORT_ASC})
      .where(['not in', 'elements.id', excludeIds])
      .one()
  %}
  </code></pre>
  
  <p><code>.where(['not in', 'elements.id', excludeIds])</code> will remove all ids in your field from your query.</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-07-31T06:40:59.490Z
Answers.LastActivityDate: 2018-07-31T06:40:59.490Z
Answers.UserDisplayName: Robin Schambach
Body: <p>I'm trying to show the next post that's not in the array of articles "completed". I have the next articles showing that haven't been completed, however i can't set a limit to just show one article. Any ideas?</p>
  
  <p>here's my code </p>
  
  <pre><code>{% for entry in craft.entries.section(['getStarted', 'rollOut', 'assessAndPrioritize', 'agreeCommit','measureSuccess']).order('stepNumber asc')  %}
  
      {% set test = currentUser and entry.id not in currentUser.completed.ids()  %}
  
      {% if test == true %}
          {{entry.title}}&lt;br&gt;
      {% endif %}
  
  {% endfor %}
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 4.0
Comments.CreationDate: 2018-07-31T02:11:32.560Z
Comments.Text: Forgot to mention the limit works on the first article, but when it's "completed" and is in the entries field on the user side, it just shows blank.
Comments.UserDisplayName: Kevin Love
Tags: <entries><craft3>
Title: Limit not working
ThreadText: # Limit not working
  
  (Asked by: username_0 on 2018-07-31)
  
  I'm trying to show the next post that's not in the array of articles "completed". I have the next articles showing that haven't been completed, however i can't set a limit to just show one article. Any ideas?
  
  here's my code
  
  ```
  {% for entry in craft.entries.section(['getStarted', 'rollOut', 'assessAndPrioritize', 'agreeCommit','measureSuccess']).order('stepNumber asc')  %}
  
      {% set test = currentUser and entry.id not in currentUser.completed.ids()  %}
  
      {% if test == true %}
          {{entry.title}}<br>
      {% endif %}
  
  {% endfor %}
  
  ```
  
  **Tags:** entries, craft3
  
  > **Comments:**
  > **username_0**: Forgot to mention the limit works on the first article, but when it's "completed" and is in the entries field on the user side, it just shows blank.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-07-31. Score: 2
  
  You need to exclude the ids from the beginning.
  
  ```
  {% set excludeIds = currentUser.completed.ids() %}
  {% set entry = craft
      .entries
      .section([
          'getStarted',
          'rollOut',
          'assessAndPrioritize',
          'agreeCommit',
          'measureSuccess'
      ])
      .order({stepNumber: SORT_ASC})
      .where(['not in', 'elements.id', excludeIds])
      .one()
  %}
  
  ```
  
  `.where(['not in', 'elements.id', excludeIds])` will remove all ids in your field from your query.
  
  
  ---
  
  