# How to reference current workflow State in a markdown template?

**URL:** <https://community.fibery.io/t/how-to-reference-current-workflow-state-in-a-markdown-template/5695>\
**Category:** Get Help\
**Created:** [January 17, 2024, 1:23am UTC](https://community.fibery.io/t/how-to-reference-current-workflow-state-in-a-markdown-template/5695 "2024-01-17T01:23:19Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [January 17, 2024, 1:23am UTC](https://community.fibery.io/t/how-to-reference-current-workflow-state-in-a-markdown-template/5695/1 "2024-01-17T01:23:19Z")

</div>

“Failed to execute Action: Cannot read property ‘Name’ of undefined”

Entity.State is apparently null:

```auto
{! State:Name !}
<%= Entity.State.Name %>

```

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [January 17, 2024, 7:45am UTC](https://community.fibery.io/t/how-to-reference-current-workflow-state-in-a-markdown-template/5695/2 "2024-01-17T07:45:38Z")

</div>

You can use

~~`{{ State.Name }}`~~  
`{{State.Name}}`

(period is used to get a property of a to-one related entity, colon is used to get properties of to-many related entities)

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [January 18, 2024, 9:03pm UTC](https://community.fibery.io/t/how-to-reference-current-workflow-state-in-a-markdown-template/5695/3 "2024-01-18T21:03:20Z")

</div>

@Chr1sG - neither of those methods work. That’s why I’m asking.

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/3/39019c265702d5d311183f1c7ef1c8f7650ce3d5.png)

* * *

 ![image](https://us1.discourse-cdn.com/flex020/uploads/fibery/original/2X/8/82f00bd8e804edb2a7fb6bf622e56fb797844d4b.png)

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [January 18, 2024, 9:35pm UTC](https://community.fibery.io/t/how-to-reference-current-workflow-state-in-a-markdown-template/5695/4 "2024-01-18T21:35:58Z")

</div>

Sorry. There were unnecessary spaces.  
Try  
`{{State.Name}}`

---

<div class="post-metadata">

**Author:** ![Matt\_Blais](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/matt_blais/32/1464_2.png) [@Matt\_Blais](https://community.fibery.io/u/Matt_Blais)\
**Post date:** [January 18, 2024, 9:40pm UTC](https://community.fibery.io/t/how-to-reference-current-workflow-state-in-a-markdown-template/5695/5 "2024-01-18T21:40:52Z")

</div>

Thanks - `{{State.Name}}` indeed does work with the spaces removed.

This, however, still generates the error noted above:

```auto
{! State:Name !}
<%= Entity.State.Name %>

```

---

<div class="post-metadata">

**Author:** ![Chr1sG](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/chr1sg/32/3941_2.png) [@Chr1sG](https://community.fibery.io/u/Chr1sG)\
**Post date:** [January 18, 2024, 9:43pm UTC](https://community.fibery.io/t/how-to-reference-current-workflow-state-in-a-markdown-template/5695/6 "2024-01-18T21:43:23Z")

</div>

> [@Matt\_Blais](#):
>
> This, however, still generates the error noted above:
> 
> ```auto
> {! State:Name !}
> <%= Entity.State.Name %>
> 
> ```

Yes, sorry for the confusion. This syntax is appropriate when you want to declare a collection with specific property(ies) so that it can then be used in Javascript.  
e.g.

```auto
{! Collection:Name !}
<%= Entity.Collection.map((item) => item.Name).join(` | `) %>

```
