How to make automation notification message conditional?

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

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?

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

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

Just regular text, single line.

Hi, @Dimitri_S

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

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

Please let me know about any questions or comments.



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:


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.


Hi, @Dimitri_S

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