Answers.Body: <p>I have never tried it on a table field, but you could try:</p>
  
  <pre><code>{% for row in block.example.limit('1').order('RAND()') %}
      {{ row.examplerow }}
  {% endfor %} 
  </code></pre>
  
  <p><strong>OK, above will not work</strong>. I went back on my theory and actually tried it on a table field I had laying around. This worked for me:</p>
  
  <pre><code>{% set rows = shuffle(block.example) %}
  
  {% for row in rows | slice(0, 1) %}
     {{ row.examplerow }}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T19:12:22.663Z
Answers.Text: If that does work, and returns a single row, you wouldn't need the `for` loop.
Answers.UserDisplayName: Stephen Lewis
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T19:43:08.880Z
Answers.Text: Thanks for that AbbeyDesign, I tried that and now it returns no records.
Answers.UserDisplayName: Vin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T19:57:01.197Z
Answers.Text: What kind of field is it that you are trying to loop through?
Answers.UserDisplayName: AbbeyDesign
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T20:28:56.543Z
Answers.Text: Trying to loop through a Table field in Matrix.
Answers.UserDisplayName: Vin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T20:53:13.500Z
Answers.Text: @Vin I edited the code above. Let me know if that works. I tried it on a table field I had and it worked for me.
Answers.UserDisplayName: AbbeyDesign
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T21:32:07.330Z
Answers.Text: AbbeyDesign you rock!!! That worked perfect :)
Answers.UserDisplayName: Vin
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-04-25T19:08:08.903Z
Answers.LastActivityDate: 2017-04-26T18:48:22.060Z
Answers.LastEditDate: 2017-04-26T18:48:22.060Z
Answers.UserDisplayName: AbbeyDesign
Body: <p>This is my code I am using, but want to limit it to just one and possibly randomize it also.  Is it possible with Table, I looked at the example on Craft's site but did not see that option.</p>
  
  <pre><code>{% for row in block.example %}
      {{ row.examplerow }}
  {% endfor %} 
  </code></pre>
  
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-25T20:12:39.067Z
Comments.Text: Have a look at: http://stackoverflow.com/a/38677493/26130
Comments.UserDisplayName: Brad
Comments.ContentLicense: CC BY-SA 3.0
Comments.CreationDate: 2017-04-25T20:28:29.827Z
Comments.Text: Brad that is something I tried before but it errors as an unknown filter shuffle.  I did take out the shuffle and tried just slice(0,1) and it worked.  Just need the random part now.
Comments.UserDisplayName: Vin
Tags: <table-field>
Title: Limit rows using Table
ThreadText: # Limit rows using Table
  
  (Asked by: username_0 on 2017-04-25)
  
  This is my code I am using, but want to limit it to just one and possibly randomize it also. Is it possible with Table, I looked at the example on Craft's site but did not see that option.
  
  ```
  {% for row in block.example %}
      {{ row.examplerow }}
  {% endfor %} 
  
  ```
  
  **Tags:** table-field
  
  > **Comments:**
  > **username_1**: Have a look at: http://stackoverflow.com/a/38677493/26130  
  > **username_0**: username_1 that is something I tried before but it errors as an unknown filter shuffle.  I did take out the shuffle and tried just slice(0,1) and it worked.  Just need the random part now.  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_2 on 2017-04-25. Score: 3 | Accepted answer
  
  I have never tried it on a table field, but you could try:
  
  ```
  {% for row in block.example.limit('1').order('RAND()') %}
      {{ row.examplerow }}
  {% endfor %} 
  
  ```
  
  **OK, above will not work**. I went back on my theory and actually tried it on a table field I had laying around. This worked for me:
  
  ```
  {% set rows = shuffle(block.example) %}
  
  {% for row in rows | slice(0, 1) %}
     {{ row.examplerow }}
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_3**: If that does work, and returns a single row, you wouldn't need the `for` loop.  
  > **username_0**: Thanks for that username_2, I tried that and now it returns no records.  
  > **username_2**: What kind of field is it that you are trying to loop through?  
  > **username_0**: Trying to loop through a Table field in Matrix.  
  > **username_2**: @username_0 I edited the code above. Let me know if that works. I tried it on a table field I had and it worked for me.  
  > **username_0**: username_2 you rock!!! That worked perfect :)  
  
  ---
  
  