Answers.Body: <p>You could try something like:</p>
  
  <pre><code>{% for entry in entries %}
    {% for image in entry.portfolio.orderBy('RAND()').limit(8)
      &lt;img src="{{ image.getUrl() }}"&gt;
    {% endfor %}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2015-05-29T12:19:31.637Z
Answers.LastActivityDate: 2015-05-29T12:19:31.637Z
Answers.UserDisplayName: Alec Ritson
Body: <p>Im looking up the last 2 entries like this</p>
  
  <pre><code>{% set entries = craft.entries.section('report').limit(2) %}
  </code></pre>
  
  <p>My entry got an assets field called 'portfolio'. I would like to retrieve 8 images in random order. How would I do this?</p>
  
Tags: <templating><entries><forloop>
Title: retrieve assets from an entries
ThreadText: # retrieve assets from an entries
  
  (Asked by: username_0 on 2015-05-29)
  
  Im looking up the last 2 entries like this
  
  ```
  {% set entries = craft.entries.section('report').limit(2) %}
  
  ```
  
  My entry got an assets field called 'portfolio'. I would like to retrieve 8 images in random order. How would I do this?
  
  **Tags:** templating, entries, forloop
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2015-05-29. Score: 2 | Accepted answer
  
  You could try something like:
  
  ```
  {% for entry in entries %}
    {% for image in entry.portfolio.orderBy('RAND()').limit(8)
      <img src="{{ image.getUrl() }}">
    {% endfor %}
  {% endfor %}
  
  ```
  
  
  ---
  
  