# How to make automation notification message conditional?

**URL:** <https://community.fibery.io/t/how-to-make-automation-notification-message-conditional/2286>\
**Category:** Get Help\
**Tags:** automations\
**Created:** [December 1, 2021, 7:47pm UTC](https://community.fibery.io/t/how-to-make-automation-notification-message-conditional/2286 "2021-12-01T19:47:05Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)\
**Post date:** [December 1, 2021, 7:47pm UTC](https://community.fibery.io/t/how-to-make-automation-notification-message-conditional/2286/1 "2021-12-01T19:47:05Z")

</div>

For notifications I want to only have a message if there is value for one.

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

In the example above, if the **Follow Up Note** has a value I want it included, if there is no note then I want the message to be blank so just the subject is sent.

Pretty new to using JavaScript code in templates, I imagine for Message it would be something like this?

```auto
<%=
<% Follow Up Note %> && `Note: ${<% Follow Up Note %>}`
%>

```

---

<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:** [December 1, 2021, 8:11pm UTC](https://community.fibery.io/t/how-to-make-automation-notification-message-conditional/2286/2 "2021-12-01T20:11:48Z")

</div>

What sort of field is Follow Up Note? Rich text?

---

<div class="post-metadata">

**Author:** ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)\
**Post date:** [December 1, 2021, 8:20pm UTC](https://community.fibery.io/t/how-to-make-automation-notification-message-conditional/2286/3 "2021-12-01T20:20:23Z")

</div>

Just regular text, single line.

---

<div class="post-metadata">

**Author:** ![Oleg](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/oleg/32/1887_2.png) [@Oleg](https://community.fibery.io/u/Oleg)\
**Post date:** [December 2, 2021, 8:44am UTC](https://community.fibery.io/t/how-to-make-automation-notification-message-conditional/2286/4 "2021-12-02T08:44:09Z")

</div>

Hi, @Dimitri_S

Thanks for the question. Assuming that I have simple text field “Note”. Please find below the code:

```auto
<% if (Field(`Note`)) {%>Follow up: {{Note}}<%}%>

```

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

Please let me know about any questions or comments.

Thanks,  
Oleg

---

<div class="post-metadata">

**Author:** ![Dimitri\_S](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/dimitri_s/32/1683_2.png) [@Dimitri\_S](https://community.fibery.io/u/Dimitri_S)\
**Post date:** [December 6, 2021, 1:15pm UTC](https://community.fibery.io/t/how-to-make-automation-notification-message-conditional/2286/5 "2021-12-06T13:15:24Z")

</div>

Looks like this _almost_ works. Here is what I am using:

**Subject:** `Follow up: {{Name}}`  
**Message:** `<% if (Field(`Follow Up Note`)) {%>Note: {{Follow Up Note}}<%}%>`

And the notifications on Fibery look perfect:

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

But the notifications on Slack are a bit off. That is to say the entity linking is broken somehow for the entity with the conditional note message.

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

---

<div class="post-metadata">

**Author:** ![Oleg](https://sea2.discourse-cdn.com/flex020/user_avatar/community.fibery.io/oleg/32/1887_2.png) [@Oleg](https://community.fibery.io/u/Oleg)\
**Post date:** [December 6, 2021, 2:22pm UTC](https://community.fibery.io/t/how-to-make-automation-notification-message-conditional/2286/6 "2021-12-06T14:22:35Z")

</div>

Hi, @Dimitri_S

Thanks for letting us know. We will investigate the issue. Looks like a bug. Will let you know.

Thanks,  
Oleg
