Answers.Body: <p>I got it to work with this code:</p>
  
  <pre><code>{% for entry in entries %}
  
      {% set myArray = [entry.title] %}
  
      {% for block in entry.myMatrixField %}
  
          {% set myArray = myArray|merge([block.field1,block.field2,block.field3]) %}  
  
      {% endfor %}
  
      {% do craft.sproutReports.addRow(myArray) %}
  
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-07T22:53:07.057Z
Answers.LastActivityDate: 2019-05-07T22:53:07.057Z
Answers.UserDisplayName: SoHo
Answers.Body: <p>Try the below code</p>
  
  <pre><code>{% for block in entry.myMatrixField %}
    {% if block.type == "sproutReports" %}
      &lt;blockquote class="sproutReports{{ loop.index }}"&gt;
        &lt;p&gt;{{ block.sproutReports}}&lt;/p&gt;
      &lt;/blockquote&gt;
    {% endif %}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-07T22:41:14.680Z
Answers.Text: My question was specific to Sprout Reports plugin.
Answers.UserDisplayName: SoHo
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2019-05-07T22:38:42.620Z
Answers.LastActivityDate: 2019-05-07T22:38:42.620Z
Answers.UserDisplayName: Priti Rathod
Body: <p>I'm not clear on how I would iterate over a Matrix field to be able to include the content in the row.</p>
  
  <p>Wish there was an example in the docs: <a href="https://sprout.barrelstrengthdesign.com/docs/reports/custom-twig-template-report.html#template-settings" rel="nofollow noreferrer">https://sprout.barrelstrengthdesign.com/docs/reports/custom-twig-template-report.html#template-settings</a></p>
  
  <pre><code>{% for entry in entries %}
  
      {% do craft.sproutReports.addRow([
        entry.title, 
        entry.myMatrixField
      ]) %}
  
  {% endfor %}
  </code></pre>
  
Tags: <craft3><matrix><plugins><plugin-sproutreports>
Title: Sprout Reports plugin - How to output a Matrix field into a row
ThreadText: # Sprout Reports plugin - How to output a Matrix field into a row
  
  (Asked by: username_0 on 2019-05-07)
  
  I'm not clear on how I would iterate over a Matrix field to be able to include the content in the row.
  
  Wish there was an example in the docs: <https://sprout.barrelstrengthdesign.com/docs/reports/custom-twig-template-report.html#template-settings>
  
  ```
  {% for entry in entries %}
  
      {% do craft.sproutReports.addRow([
        entry.title, 
        entry.myMatrixField
      ]) %}
  
  {% endfor %}
  
  ```
  
  **Tags:** craft3, matrix, plugins, plugin-sproutreports
  
  
  ---
  
  ## 2 answers
  
  ### Answer by username_0 on 2019-05-07. Score: 2 | Accepted answer
  
  I got it to work with this code:
  
  ```
  {% for entry in entries %}
  
      {% set myArray = [entry.title] %}
  
      {% for block in entry.myMatrixField %}
  
          {% set myArray = myArray|merge([block.field1,block.field2,block.field3]) %}  
  
      {% endfor %}
  
      {% do craft.sproutReports.addRow(myArray) %}
  
  {% endfor %}
  
  ```
  
  
  ---
  
  ### Answer by username_1 on 2019-05-07. Score: -1
  
  Try the below code
  
  ```
  {% for block in entry.myMatrixField %}
    {% if block.type == "sproutReports" %}
      <blockquote class="sproutReports{{ loop.index }}">
        <p>{{ block.sproutReports}}</p>
      </blockquote>
    {% endif %}
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: My question was specific to Sprout Reports plugin.  
  
  ---
  
  