Doc merge Javascript

Hello, All

I have a question concerning Doc merge template

I am trying to show different text depending on if a field conntains a specfic word

I have followed the documents and saw something like this:

Example

This example will show the dp_business_purpose field in the Contacts module if the business purpose contains the word "Marketing". If you do not see this field in your contact's record view, you may need to add it to the layout in Studio.

{if (dp_business_purpose.filter(item=>item.includes("Marketing")).length>0)}
{dp_business_purpose}
{else}
NONE
{endif}

it seems like it is using javascript syntax.

I tried using includes on a string but it gives an errror "un expected token"

so, my question would be, how do I go with implemening this?

any help would be apprciated

Parents Reply Children
No Data