Answers.Body: <p>You could use the <a href="http://buildwithcraft.com/docs/templating/filters#without" rel="nofollow"><code>without</code></a> filter for this:</p>
  
  <pre><code>{% set entryParams = {
      section: mySection1
  } %}
  
  {% set relationParams = {
      sourceElement: mySection2,
      field: myEntriesField
  } %}
  
  {% set entriesWithRelation = craft.entries(params).relatedTo(relationParams).find() %}
  {% set entriesWithoutRelation = craft.entries(params)|without(entriesWithRelation) %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-05T13:54:08.307Z
Answers.Text: Without getting to the second without part, the  entriesWithRelation setting with relatedTo outputs every single entry in the system regardless of section.
  
  Looking at the docs http://buildwithcraft.com/docs/relations I'm certain that what I'm trying to do is relatively easy, which in the first instance is:
  
  if any mySection1 entries have been made a relation in mySection2 list them here...
Answers.UserDisplayName: Simon Clayson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-05T13:59:43.733Z
Answers.Text: You probably have a lot of different kind of relations, that can make it necessary to further narrow down the query, @Simon. Will update the code...
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-05T17:46:54.987Z
Answers.Text: There are about 3 relationship fields in mySection2 entries indeed.
Answers.UserDisplayName: Simon Clayson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-05T21:40:51.150Z
Answers.Text: Did you get this to work now, @Simon? By specifying the element and the field of your relation you should probably be good!
Answers.UserDisplayName: carlcs
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-07T07:49:47.940Z
Answers.Text: Got halfway there - will update later thanks.
Answers.UserDisplayName: Simon Clayson
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2014-12-04T23:50:40.487Z
Answers.LastActivityDate: 2014-12-05T14:00:23.480Z
Answers.LastEditDate: 2014-12-05T14:00:23.480Z
Answers.UserDisplayName: carlcs
Body: <p>I have a list of entries and I would like to filter them into 2 lists.</p>
  
  <ol>
  <li>Entries that have been made a relation in another section</li>
  <li>Entries that have NOT been made a relation in another section</li>
  </ol>
  
  <p>I thought about tackling this the other way round and listing the section with the relations but some entires are related multiple times, so and the titles in the list get repeated multiple times. Unless this can filter out the duplicates, but it starts to get messy at this point. </p>
  
  <p>Ideas welcome thanks.</p>
  
Tags: <entries><relations>
Title: List Entries in a section that are referenced as a relation in another
ThreadText: # List Entries in a section that are referenced as a relation in another
  
  (Asked by: username_0 on 2014-12-04)
  
  I have a list of entries and I would like to filter them into 2 lists.
  
  1. Entries that have been made a relation in another section
  2. Entries that have NOT been made a relation in another section
  
  I thought about tackling this the other way round and listing the section with the relations but some entires are related multiple times, so and the titles in the list get repeated multiple times. Unless this can filter out the duplicates, but it starts to get messy at this point.
  
  Ideas welcome thanks.
  
  **Tags:** entries, relations
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2014-12-04. Score: 1
  
  You could use the [`without`](http://buildwithcraft.com/docs/templating/filters#without) filter for this:
  
  ```
  {% set entryParams = {
      section: mySection1
  } %}
  
  {% set relationParams = {
      sourceElement: mySection2,
      field: myEntriesField
  } %}
  
  {% set entriesWithRelation = craft.entries(params).relatedTo(relationParams).find() %}
  {% set entriesWithoutRelation = craft.entries(params)|without(entriesWithRelation) %}
  
  ```
  
  > **Comments:**
  > **username_0**: Without getting to the second without part, the  entriesWithRelation setting with relatedTo outputs every single entry in the system regardless of section.  Looking at the docs http://buildwithcraft.com/docs/relations I'm certain that what I'm trying to do is relatively easy, which in the first instance is:  if any mySection1 entries have been made a relation in mySection2 list them here...  
  > **username_1**: You probably have a lot of different kind of relations, that can make it necessary to further narrow down the query, @username_0. Will update the code...  
  > **username_0**: There are about 3 relationship fields in mySection2 entries indeed.  
  > **username_1**: Did you get this to work now, @username_0? By specifying the element and the field of your relation you should probably be good!  
  > **username_0**: Got halfway there - will update later thanks.  
  
  ---
  
  