Answers.Body: <p>You might have seen <a href="https://docs.craftcms.com/v2/relations.html#the-relatedto-param" rel="nofollow noreferrer">Passing Multiple Relation Criteria</a>  in the docs</p>
  
  <pre><code>{% set entries = craft.entries.section('flightcompany').relatedTo([
      'and',
      { targetElement: models, field: 'partsModels.model' },
      { targetElement: parts, field: 'partsModels.part' }
  ]).all() %}
  </code></pre>
  
  <p>You can as well take a look at the <a href="https://docs.craftcms.com/v3/element-queries.html#param-value-syntax" rel="nofollow noreferrer">Db::parseParam</a> the <code>and|or</code> syntax is the same for this field</p>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-10T22:30:13.170Z
Answers.Text: Perfect! Thanks again Robin, you really have helped me out again :)
Answers.UserDisplayName: Vin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-12T19:21:03.010Z
Answers.Text: It seems I tried this and it came back with no results.  I am trying to get the results between 2 matrix fields.  Right now I am using conditionals and using .limit(25) and with the conditionals in the matrix loop I sometimes only get 4-5 results.  So would be best to get them at the main entries loop.
Answers.UserDisplayName: Vin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-12T19:38:00.300Z
Answers.Text: Sorry but it's really difficult to understand your explanation. What do you want exactly? You won't fetch matrix blocks with your query. You'll receive elements of type entry. The code above works. I've used it many times without issues
Answers.UserDisplayName: Robin Schambach
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-12T21:42:07.703Z
Answers.Text: I am sure it does, not working for me, it's me not you.  I am trying to make sure that each of those conditions/data matches.  So models = cessna and parts = front propeller in flightcompany limit 25 records.  Those records exist in the extries but for some reason it works with just searching parts or models but not used together with 'and'.
Answers.UserDisplayName: Vin
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2018-05-10T19:29:45.697Z
Answers.LastActivityDate: 2018-05-18T23:26:01.507Z
Answers.LastEditDate: 2018-05-18T23:26:01.507Z
Answers.UserDisplayName: Robin Schambach
Body: <p>I am trying to accomplish targeting but wondering if there is a way to combine these two? I took a look around and in the Craft 3 docs but I am a bit turned around on this, really would appreciate some help with it.</p>
  
  <pre><code>{% set parts = craft.categories.group('part').slug( urlSlug2 ) %}
  {% set models = craft.categories.group('model').slug( urlSlug3 ) %}
  
  {% set entries1 = craft.entries.section('flightcompany').relatedTo({
      targetElement: parts, 
      field: 'partsModels.part' 
  }).limit(5).all() %}
  
  {% set entries2 = craft.entries.section('flightcompany').relatedTo({
      targetElement: models, 
      field: 'partsModels.model' 
  }).limit(5).all() %}
  </code></pre>
  
Tags: <craft3><relations>
Title: Combining Multiple Relation
ThreadText: # Combining Multiple Relation
  
  (Asked by: username_0 on 2018-05-10)
  
  I am trying to accomplish targeting but wondering if there is a way to combine these two? I took a look around and in the Craft 3 docs but I am a bit turned around on this, really would appreciate some help with it.
  
  ```
  {% set parts = craft.categories.group('part').slug( urlSlug2 ) %}
  {% set models = craft.categories.group('model').slug( urlSlug3 ) %}
  
  {% set entries1 = craft.entries.section('flightcompany').relatedTo({
      targetElement: parts, 
      field: 'partsModels.part' 
  }).limit(5).all() %}
  
  {% set entries2 = craft.entries.section('flightcompany').relatedTo({
      targetElement: models, 
      field: 'partsModels.model' 
  }).limit(5).all() %}
  
  ```
  
  **Tags:** craft3, relations
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2018-05-10. Score: 5 | Accepted answer
  
  You might have seen [Passing Multiple Relation Criteria](https://docs.craftcms.com/v2/relations.html#the-relatedto-param) in the docs
  
  ```
  {% set entries = craft.entries.section('flightcompany').relatedTo([
      'and',
      { targetElement: models, field: 'partsModels.model' },
      { targetElement: parts, field: 'partsModels.part' }
  ]).all() %}
  
  ```
  
  You can as well take a look at the [Db::parseParam](https://docs.craftcms.com/v3/element-queries.html#param-value-syntax) the `and|or` syntax is the same for this field
  
  > **Comments:**
  > **username_0**: Perfect! Thanks again username_1, you really have helped me out again :)  
  > **username_0**: It seems I tried this and it came back with no results.  I am trying to get the results between 2 matrix fields.  Right now I am using conditionals and using .limit(25) and with the conditionals in the matrix loop I sometimes only get 4-5 results.  So would be best to get them at the main entries loop.  
  > **username_1**: Sorry but it's really difficult to understand your explanation. What do you want exactly? You won't fetch matrix blocks with your query. You'll receive elements of type entry. The code above works. I've used it many times without issues  
  > **username_0**: I am sure it does, not working for me, it's me not you.  I am trying to make sure that each of those conditions/data matches.  So models = cessna and parts = front propeller in flightcompany limit 25 records.  Those records exist in the extries but for some reason it works with just searching parts or models but not used together with 'and'.  
  
  ---
  
  