<p>So I had to adjust Brads code slightly and tweak it to get what I wanted.</p>

<p>Issue: I was getting some entrys but not all the entrys I wanted when I was pulling a list as one of my entryfields for my page was a channel.</p>

<p>When I was pulling the information for my authorName from myEntry, myEntry was assigned to the channel field and would only pick up and register the first author entry i created. I had to change <code>{{ myEntry.AuthorName }}</code> to <code>{{ myEntry.Title }}</code> as the channel entry for each author had a title field.</p>

<pre><code>{% if entry.authorTeamMember|length %} 
    {% set myEntry = entry.authorTeamMember.first() %}

    {{ myEntry.Title }}
    {{ myEntry.authorDescription }}
{% else %}
    &lt;p&gt;No Author&lt;/p&gt;
{% endif %}
</code></pre>

CC BY-SA 3.0
2017-09-22T21:58:05.637Z
2017-09-23T03:33:30.813Z
2017-09-23T03:33:30.813Z
Matthew Dillon
<p>You're close!</p>

<p>You select the author correctly with and assign it to the <code>myEntry</code> variable:</p>

<pre><code>{% set myEntry = entry.authorTeamMember.first() %}
</code></pre>

<p>Now you just need to output the data from <code>myEntry</code> instead of <code>entry</code>.  i.e.</p>

<pre><code>{% if entry.authorTeamMember|length %} 
    {% set myEntry = entry.authorTeamMember.first() %}

    {{ myEntry.authorName }}
    {{ myEntry.authorDescription }}
{% else %}
    &lt;p&gt;No Author&lt;/p&gt;
{% endif %}
</code></pre>

CC BY-SA 3.0
2017-09-21T23:52:11.873Z
Thanks! I knew I was overlooking something simple somewhere!
Matthew Dillon
CC BY-SA 3.0
2017-09-22T02:05:20.090Z
So working with it, it will pull the first entry in the authorTeamMember channel perfectly but wont recognize other authors if the code is in a loop pulling other entries for other authors. I am thinking it has to do with the .first() tag when I am setting  the variable myEntry.  Is there a way in the set tag to set entry.authorTeamMember to whatever option a is selected per article?
Matthew Dillon
CC BY-SA 3.0
2017-09-21T22:42:14.290Z
2017-09-21T22:42:14.290Z
Brad Bell
<p>How would you go about pulling a selected entry from one channel into another entry using Craft variables?</p>

<p>For example, I have a page with an author channel field that allows a user to select the author from entries in an author channel. Once selected, I am wanting the page to display the author content from the selected Author entry.</p>

<p>I have tried using the following but have gotten no output.</p>

<pre><code>{% if entry.authorTeamMember|length %} 
    {% set myEntry = entry.authorTeamMember.first() %}

    {{entry.authorName}}
    {{entry.authorDescription}}
{% else %}
    &lt;p&gt;No Author&lt;/p&gt;
{% endif %}
</code></pre>

<entries-field><channels>
Calling Sub Channel Entries
# Calling Sub Channel Entries

(Asked by: username_0 on 2017-09-21)

How would you go about pulling a selected entry from one channel into another entry using Craft variables?
For example, I have a page with an author channel field that allows a user to select the author from entries in an author channel. Once selected, I am wanting the page to display the author content from the selected Author entry.
I have tried using the following but have gotten no output.
{% if entry.authorTeamMember|length %} 
    {% set myEntry = entry.authorTeamMember.first() %}

    {{entry.authorName}}
    {{entry.authorDescription}}
{% else %}
    No Author
{% endif %}

**Tags:** entries-field, channels


---

## 2 answers

### Answer by username_0 on 2017-09-22. Score: 0 | Accepted answer

So I had to adjust Brads code slightly and tweak it to get what I wanted.
Issue: I was getting some entrys but not all the entrys I wanted when I was pulling a list as one of my entryfields for my page was a channel.
When I was pulling the information for my authorName from myEntry, myEntry was assigned to the channel field and would only pick up and register the first author entry i created. I had to change {{ myEntry.AuthorName }} to {{ myEntry.Title }} as the channel entry for each author had a title field.
{% if entry.authorTeamMember|length %} 
    {% set myEntry = entry.authorTeamMember.first() %}

    {{ myEntry.Title }}
    {{ myEntry.authorDescription }}
{% else %}
    No Author
{% endif %}


---

### Answer by username_1 on 2017-09-21. Score: 0

You're close!
You select the author correctly with and assign it to the myEntry variable:
{% set myEntry = entry.authorTeamMember.first() %}

Now you just need to output the data from myEntry instead of entry.  i.e.
{% if entry.authorTeamMember|length %} 
    {% set myEntry = entry.authorTeamMember.first() %}

    {{ myEntry.authorName }}
    {{ myEntry.authorDescription }}
{% else %}
    No Author
{% endif %}

> **Comments:**
> **username_0**: Thanks! I knew I was overlooking something simple somewhere!  
> **username_0**: So working with it, it will pull the first entry in the authorTeamMember channel perfectly but wont recognize other authors if the code is in a loop pulling other entries for other authors. I am thinking it has to do with the .first() tag when I am setting  the variable myEntry.  Is there a way in the set tag to set entry.authorTeamMember to whatever option a is selected per article?  

---

