Answers.Body: <p>Yes, this is possible using the <a href="https://twig.symfony.com/doc/3.x/tags/for.html#the-loop-variable" rel="nofollow noreferrer">Twig Loop variable</a>. The following will add the current iteration of the loop.</p>
  <pre><code>{% for row in block.buttons %}
      {{ loop.index }}
  {% endfor %}
  </code></pre>
  
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-04T18:11:16.250Z
Answers.Text: Perfect.  Thank you!
Answers.UserDisplayName: fodney
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-11T08:23:02.533Z
Answers.Text: Beware that `index` starts at 1. If you need 0-indexed, use `index0`.
Answers.UserDisplayName: PWL
Answers.ContentLicense: CC BY-SA 4.0
Answers.CreationDate: 2022-02-03T21:23:26.423Z
Answers.LastActivityDate: 2022-02-03T21:23:26.423Z
Answers.UserDisplayName: Anna_MediaGirl
Body: <p>I need a unique id for each table row.  Something like this which does not work:</p>
  <p><code>{% for row in block.buttons %}{{ row.id }}{% endfor %}</code></p>
  <p>Is this possible?</p>
  <p>Thanks!</p>
  
Tags: <templating><table-field>
Title: Table Field Row ID?
ThreadText: # Table Field Row ID?
  
  (Asked by: username_0 on 2022-02-03)
  
  I need a unique id for each table row. Something like this which does not work:
  
  `{% for row in block.buttons %}{{ row.id }}{% endfor %}`
  
  Is this possible?
  
  Thanks!
  
  **Tags:** templating, table-field
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2022-02-03. Score: 1
  
  Yes, this is possible using the [Twig Loop variable](https://twig.symfony.com/doc/3.x/tags/for.html#the-loop-variable). The following will add the current iteration of the loop.
  
  ```
  {% for row in block.buttons %}
      {{ loop.index }}
  {% endfor %}
  
  ```
  
  > **Comments:**
  > **username_0**: Perfect.  Thank you!  
  > **username_2**: Beware that `index` starts at 1. If you need 0-indexed, use `index0`.  
  
  ---
  
  