<p>Try this:</p>

<pre><code>{% set value = craft.entries.section('mySectionHandle').type('entryTypeHandle').first().myTextFieldHandle %}

{{ value }}
</code></pre>

<p>Just with your field handle at the end</p>

CC BY-SA 4.0
2018-11-03T20:57:13.570Z
2018-11-03T20:57:13.570Z
Barbara Cinotti
<p>I am trying to get a value of a text field that is in a Section which is a <em>structure</em> and has multiple entry types. I don't want to use a loop. I tried this and some other variations but does not give me the correct value.</p>

<pre><code>{% set value = craft.entries.section('mySectionHandle').type('entryTypeHandle').myTextFieldHandle.first() %}
</code></pre>

<p>What is the correct syntax? Thanks.</p>

<templating><craft2>
How to directly get value of text field in a given section of type structure?
# How to directly get value of text field in a given section of type structure?

(Asked by: username_0 on 2018-11-03)

I am trying to get a value of a text field that is in a Section which is a structure and has multiple entry types. I don't want to use a loop. I tried this and some other variations but does not give me the correct value.
{% set value = craft.entries.section('mySectionHandle').type('entryTypeHandle').myTextFieldHandle.first() %}

What is the correct syntax? Thanks.

**Tags:** templating, craft2


---

## 1 answers

### Answer by username_1 on 2018-11-03. Score: 3 | Accepted answer

Try this:
{% set value = craft.entries.section('mySectionHandle').type('entryTypeHandle').first().myTextFieldHandle %}

{{ value }}

Just with your field handle at the end


---

