<p>I Think this should work:</p>

<pre><code>{% for entry in craft.entries.section('team').limit(1).order('RAND()').schedulerBio(':notempty:') %}
   ...stuff
{% endfor %}
</code></pre>

CC BY-SA 3.0
2016-08-17T01:03:06.843Z
Thanks so much! That worked perfectly. I had not tried notempty.
glider
CC BY-SA 3.0
2016-08-17T00:16:40.807Z
2016-08-17T00:16:40.807Z
AbbeyDesign
<p>I'm trying to select 1 random entry out of a section based on whether a field has content (<code>schedulerBio</code>). I can get all the entries based on the conditional but can't seem to randomize a single selection. Any help would be appreciated. </p>

<pre><code>{% for entry in craft.entries.section('team').limit(1).find() if entry.schedulerBio|length %}
... stuff
{% endfor }
</code></pre>

<templating><random>
Selecting a random entry based on conditional
# Selecting a random entry based on conditional

(Asked by: username_0 on 2016-08-16)

I'm trying to select 1 random entry out of a section based on whether a field has content (schedulerBio). I can get all the entries based on the conditional but can't seem to randomize a single selection. Any help would be appreciated. 
{% for entry in craft.entries.section('team').limit(1).find() if entry.schedulerBio|length %}
... stuff
{% endfor }

**Tags:** templating, random


---

## 1 answers

### Answer by username_1 on 2016-08-17. Score: 4 | Accepted answer

I Think this should work:
{% for entry in craft.entries.section('team').limit(1).order('RAND()').schedulerBio(':notempty:') %}
   ...stuff
{% endfor %}

> **Comments:**
> **username_0**: Thanks so much! That worked perfectly. I had not tried notempty.  

---

