Solved

Trying to get part of description but getting syntax error missing )

  • 9 January 2024
  • 1 reply
  • 41 views

Badge

So we have form emails that come in. Trying to get a part of the description and this was working but now all of a sudden it keeps telling me that there is a syntax error. My expression is substring( "{{ticket.description}}", indexOf("{{ticket.description}}","Start Date",0)+12, indexOf("{{ticket.description}}","Previous Dealer",0)-5). The syntax error that it gives me is Invalid Syntax - Missing ). but it does the same if you just try to get the indexOf part. My expression builder is set to string and I have tried numbers as well. Any help would be appreciated.

icon

Best answer by jlandrum 9 January 2024, 18:54

View original

1 reply

Badge

I figured it out. There was a quote ‘ in the description which was causing problems with the expression. I used liquid filter to remove the quote in the description. So my expression became

substring( "{{ticket.description | replace: "'",""}}", indexOf("{{ticket.description | replace: "'",""}}","Start Date",0)+12, indexOf("{{ticket.description | replace: "'",""}}","Previous Dealer",0)-5)

which seems to work.

Reply