Answers.Body: <p>The code above is correct, but it turns out there was an actual bug in the code if you had a number as the option value.</p>
  
  <p>This affects Freeform 1.5.1 and earlier. The next version (1.5.2) of Freeform will include a fix for this. If anyone needs a patched copy of Freeform before 1.5.2 is available, just contact us via our <a href="https://solspace.com/craft/create-ticket/freeform" rel="nofollow noreferrer">support form</a>. :)</p>
  
Answers.ContentLicense: CC BY-SA 3.0
Answers.CreationDate: 2017-06-21T17:20:17.230Z
Answers.LastActivityDate: 2017-06-21T17:20:17.230Z
Answers.UserDisplayName: Solspace
Body: <p>On the form I'm building, I've got a question with radio buttons. And the answers have custom values. e.g.</p>
  
  <p>Q: What is your favorite color?</p>
  
  <ul>
  <li>red (value: 10)</li>
  <li>blue (value: 20)</li>
  <li>yellow (value: 30) </li>
  </ul>
  
  <p>On my submissions page, I have the following code</p>
  
  <pre><code>{% for field in submission.fieldMetadata %}
  &lt;div class="row"&gt;
      &lt;div class="col-xs-3"&gt;
          &lt;b&gt;{{ field.label }}/b&gt;:
      &lt;/div&gt;
      &lt;div class="col-xs-9"&gt;
          {% set fieldValue = attribute(submission, field.handle).value %}
          {% if fieldValue is iterable %}
          &lt;ul&gt;
              {% for value in FieldValue %}
              &lt;li&gt;{{ value }}&lt;/li&gt;
              {% endfor %}
          &lt;/ul&gt;
          {% else %}
          {{ fieldValue }}
          {% endif %}
      &lt;/div&gt;
  &lt;/div&gt;
  {% endfor %}
  </code></pre>
  
  <p>And this returns:</p>
  
  <p><em>What is your favorite color: 10</em></p>
  
  <p>I'm using the values to do some funny math - so it's necessary (but unimportant to the issue at hand).</p>
  
  <p>How to do I get the value "red" to show, instead of the 10?</p>
  
  <p>attribute(submission, field.handle).value - shows the selected option's value (10)
  <br>attribute(submission, field.handle).label - shows the question (What is your favorite Color?)
  <br>attribute(submission, field.handle).handle - shows the question handle (whatIsYourFavoriteColor)</p>
  
  <p>There should be another function to get the option's value, but I can't find what it is.</p>
  
Tags: <plugin-freeform><solspace>
Title: Freeform - get option label & value on submissions page
ThreadText: # Freeform - get option label & value on submissions page
  
  (Asked by: username_0 on 2017-06-15)
  
  On the form I'm building, I've got a question with radio buttons. And the answers have custom values. e.g.
  
  Q: What is your favorite color?
  
  * red (value: 10)
  * blue (value: 20)
  * yellow (value: 30)
  
  On my submissions page, I have the following code
  
  ```
  {% for field in submission.fieldMetadata %}
  <div class="row">
      <div class="col-xs-3">
          <b>{{ field.label }}/b>:
      </div>
      <div class="col-xs-9">
          {% set fieldValue = attribute(submission, field.handle).value %}
          {% if fieldValue is iterable %}
          <ul>
              {% for value in FieldValue %}
              <li>{{ value }}</li>
              {% endfor %}
          </ul>
          {% else %}
          {{ fieldValue }}
          {% endif %}
      </div>
  </div>
  {% endfor %}
  
  ```
  
  And this returns:
  
  *What is your favorite color: 10*
  
  I'm using the values to do some funny math - so it's necessary (but unimportant to the issue at hand).
  
  How to do I get the value "red" to show, instead of the 10?
  
  attribute(submission, field.handle).value - shows the selected option's value (10)
    
  attribute(submission, field.handle).label - shows the question (What is your favorite Color?)
    
  attribute(submission, field.handle).handle - shows the question handle (whatIsYourFavoriteColor)
  
  There should be another function to get the option's value, but I can't find what it is.
  
  **Tags:** plugin-freeform, solspace
  
  
  ---
  
  ## 1 answers
  
  ### Answer by username_1 on 2017-06-21. Score: 1 | Accepted answer
  
  The code above is correct, but it turns out there was an actual bug in the code if you had a number as the option value.
  
  This affects Freeform 1.5.1 and earlier. The next version (1.5.2) of Freeform will include a fix for this. If anyone needs a patched copy of Freeform before 1.5.2 is available, just contact us via our [support form](https://username_1.com/craft/create-ticket/freeform). :)
  
  
  ---
  
  