<p>Technically the data you're seeking are under the first matrix block (not the first data of your <code>.companyName</code> - which is not valid)</p>

<pre><code>{% set relatedCaseStudy = reviewFeatured.relatedCaseStudy.first %}
{% set firstCompany = relatedCaseStudy.companyInformation.first %}
{{ firstCompany.companyName }}

</code></pre>

<p>Note: If you plan to have only one company, think about a <a href="https://github.com/verbb/super-table" rel="nofollow noreferrer">SuperTable</a> field in 'static' mode (only one occurence).</p>

CC BY-SA 4.0
2019-01-30T10:15:35.100Z
And how to find out what field types I need to fetch via "first", and which not? I've installed "inspector" plugin but it ain't helps. Twig's dump function also not good (absolutely exactly).
Clark
CC BY-SA 4.0
2019-01-30T14:39:38.217Z
`.first` is in fact a function that return the "first" element of an array/object. Every 'simple' fields (text, dropdown, etc.) aren't concern by this method. 

You can read the whole documentation fields that on Craft' website. There's a example for each field.

(https://docs.craftcms.com/v2/fields.html#field-types)
Maxime Lafrenière
CC BY-SA 4.0
2019-01-29T15:51:24.363Z
2019-01-29T18:59:42.663Z
2019-01-29T18:59:42.663Z
Maxime Lafrenière
<p>I have strange issue and cannot find out the solution for that.
I have this field (matrix with some text values): <a href="https://i.sstatic.net/tgWM7.jpg" rel="nofollow noreferrer">https://i.sstatic.net/tgWM7.jpg</a></p>

<p>Also I have this entry: <a href="https://i.sstatic.net/ALAuL.jpg" rel="nofollow noreferrer">https://i.sstatic.net/ALAuL.jpg</a></p>

<p>And this is how it rendered (it shows not value of fields but id of matrix block table): <a href="https://i.sstatic.net/twsHX.jpg" rel="nofollow noreferrer">https://i.sstatic.net/twsHX.jpg</a></p>

<p>Here is how it looks like in template: <a href="https://pastebin.com/viVbPLqj" rel="nofollow noreferrer">https://pastebin.com/viVbPLqj</a></p>

<p>I've tried multiple combinations but nothing was solution. Also other fields are works well (fields which not related to "companyInformation" matrix).</p>

<p>So what may I do wrong?</p>

CC BY-SA 4.0
2019-01-28T18:25:16.227Z
When you dump `reviewFeatured.relatedCaseStudy.first.companyInformation.companyName` what is the result ?
Maxime Lafrenière
CC BY-SA 4.0
2019-01-28T18:38:53.730Z
@MaximeLafrenière it's here (marked by red cycle): https://imgur.com/a/SR3HgQZ
It's an ID of companyInformation in 'matrixblocks' table
Clark
<craft2>
ID of matrix printed instead of value
# ID of matrix printed instead of value

(Asked by: username_0 on 2019-01-28)

I have strange issue and cannot find out the solution for that.
I have this field (matrix with some text values): <https://i.sstatic.net/tgWM7.jpg>

Also I have this entry: <https://i.sstatic.net/ALAuL.jpg>

And this is how it rendered (it shows not value of fields but id of matrix block table): <https://i.sstatic.net/twsHX.jpg>

Here is how it looks like in template: <https://pastebin.com/viVbPLqj>

I've tried multiple combinations but nothing was solution. Also other fields are works well (fields which not related to "companyInformation" matrix).

So what may I do wrong?

**Tags:** craft2
> **Comments:**
> **username_1**: When you dump `reviewFeatured.relatedCaseStudy.first.companyInformation.companyName` what is the result ?  
> **username_0**: @MaximeLafrenière it's here (marked by red cycle): https://imgur.com/a/SR3HgQZ It's an ID of companyInformation in 'matrixblocks' table  

---

## 1 answers

### Answer by username_1 on 2019-01-29. Score: 1 | Accepted answer

Technically the data you're seeking are under the first matrix block (not the first data of your .companyName - which is not valid)
{% set relatedCaseStudy = reviewFeatured.relatedCaseStudy.first %}
{% set firstCompany = relatedCaseStudy.companyInformation.first %}
{{ firstCompany.companyName }}


Note: If you plan to have only one company, think about a SuperTable field in 'static' mode (only one occurence).

> **Comments:**
> **username_0**: And how to find out what field types I need to fetch via "first", and which not? I've installed "inspector" plugin but it ain't helps. Twig's dump function also not good (absolutely exactly).  
> **username_1**: `.first` is in fact a function that return the "first" element of an array/object. Every 'simple' fields (text, dropdown, etc.) aren't concern by this method.   You can read the whole documentation fields that on Craft' website. There's a example for each field.  (https://docs.craftcms.com/v2/fields.html#field-types)  

---

