Automator: Error in Expression Builder

Hello, I’m trying to run an automation in Freshservice Automator. I’ve tried using two different expressions, but I keep on getting the same two errors that don’t make any sense. See below:
1.


2.

I’m confused because when I test them, they don’t error and come back as true:

Here are my expressions:

  1. regexMatch(‘{{ticket.latest_public_comment}}’, ‘Automation Step 1’)
  2. startsWith(trim(substring(‘{{ticket.latest_public_comment}}’, 13, length(‘{{ticket.latest_public_comment}}’))), ‘Automation Step 1’)

Any help would be grateful, thanks.

There must be something different between your test values and the actual input in your variable latest_public_comment. Have you output this variable anywhere else, like with an email to yourself?

Hello @chris.wojta ,

the problem is that {{ticket.latest_public_comment}} doesn’t contain a simple string, but an html body. I sent it to a service and this is what I got in return.
image

{
    "last_reply": "FirstName LastName : <div style=\"font-family: -apple-system,BlinkMacSystemFont,Segoe UI,Roboto,Helvetica Neue,Arial,sans-serif; font-size: 14px; \">\n<div>Kind FirstName LastName,<br><br>Ticket: <a href=\"https://helpdesk.yours/helpdesk/tickets/12345\" rel=\"noreferrer\">https://yourDomain/helpdesk/tickets/12345</a></div>\n<div><br></div>\n<div dir=\"ltr\">example reply</div>\n<div></div>\n</div>"
}

You can have a simple string by using Liquid Fileters pipe functions to strip html.

{{ticket.latest_public_comment | strip_html}}

I hope this helps.