<p>You will only get the defaults for new entries.</p>

CC BY-SA 3.0
2015-10-09T23:11:00.610Z
2015-10-09T23:11:00.610Z
carlcs
<p>In the CP I have a table field called <code>colors</code>. I have two columns, "Label" and "Value".</p>

<p>I have populated the table with two default values "Red" and "Blue" (attached).
<a href="https://i.sstatic.net/uZnIX.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/uZnIX.png" alt="enter image description here"></a></p>

<p>This table will ultimately populate a dropdown on the front end. Label being the label, and value being the value.</p>

<p>When I edit the entry that I have assigned the <code>colors</code> field to, the default values do not show. I can only choose "Add a row". I <em>do</em> want to be able to add/remove rows like this, but I'd like to have "Red" and "Blue" be there by default.</p>

<p><a href="https://i.sstatic.net/F19RG.png" rel="nofollow noreferrer"><img src="https://i.sstatic.net/F19RG.png" alt="enter image description here"></a></p>

<p>On the template level I create the dropdown like this:</p>

<pre><code>{% if entry.colors|length %}
&lt;select id="colors" name="colors"&gt;
    &lt;option value=""&gt;Select&lt;/option&gt;
    {% for color in entry.colors %}
        &lt;option value="{{ color.value }}"&gt;{{ color.label }}&lt;/option&gt;
    {% endfor %}
&lt;/select&gt;
{% endif %}
</code></pre>

<p>The drop down does not show until I enter a value in the entry. I'm not sure what I'm doing wrong so that the drop down will pull in the default values by...default.</p>

CC BY-SA 3.0
2015-10-09T17:31:53.583Z
You will only get the defaults for new entries! Do they show up with new entries?
carlcs
CC BY-SA 3.0
2015-10-09T18:08:31.207Z
What the....
I SWEAR I I TRIED THAT. 

...and yet another silly question by yours truly. Post your comment as the answer and I'll check it. Thank you!!
Damon
<table-field><drop-down><default>
How can I populate a dropdown via table field type using the default values?
# How can I populate a dropdown via table field type using the default values?

(Asked by: username_0 on 2015-10-09)

In the CP I have a table field called colors. I have two columns, "Label" and "Value".
I have populated the table with two default values "Red" and "Blue" (attached).

This table will ultimately populate a dropdown on the front end. Label being the label, and value being the value.
When I edit the entry that I have assigned the colors field to, the default values do not show. I can only choose "Add a row". I do want to be able to add/remove rows like this, but I'd like to have "Red" and "Blue" be there by default.

On the template level I create the dropdown like this:
{% if entry.colors|length %}

    Select
    {% for color in entry.colors %}
        {{ color.label }}
    {% endfor %}

{% endif %}

The drop down does not show until I enter a value in the entry. I'm not sure what I'm doing wrong so that the drop down will pull in the default values by...default.

**Tags:** table-field, drop-down, default
> **Comments:**
> **username_1**: You will only get the defaults for new entries! Do they show up with new entries?  
> **username_0**: What the.... I SWEAR I I TRIED THAT.   ...and yet another silly question by yours truly. Post your comment as the answer and I'll check it. Thank you!!  

---

## 1 answers

### Answer by username_1 on 2015-10-09. Score: 2 | Accepted answer

You will only get the defaults for new entries.


---

