Solved

Using ' in API ticket.description

  • 26 April 2023
  • 5 replies
  • 67 views

Badge

Hi

If I create a simple node in the automator that looks like:

"{{ticket.description}}"

and I test it with a string that cointains the character ‘ followed by an operator like +, -, * or / is fails.

The string: l’aria it works.

But the string: Trovane una’ + bella it fails.

Any idea how to solve that? In Italian is quite common to have in the description those charcaters.

The function replace() doesn’t work with the ‘

Thanks 

icon

Best answer by Daniel Söderlund 26 April 2023, 11:58

View original

5 replies

Userlevel 7
Badge +13

Hi

If I create a simple node in the automator that looks like:

"{{ticket.description}}"

and I test it with a string that cointains the character ‘ followed by an operator like +, -, * or / is fails.

The string: l’aria it works.

But the string: Trovane una’ + bella it fails.

Any idea how to solve that? In Italian is quite common to have in the description those charcaters.

The function replace() doesn’t work with the ‘

Thanks 

Hello, 

You need to use this sanitize_html like this {{ticket.description | sanitize_html}},

you can read more about it here (example 7) 

Powerful Placeholders with Liquid Filters : Freshservice

Userlevel 7
Badge +13

If you like to replace you can use Liquid filters: replace (shopify.dev)

Badge +1

The ticket system records requests for support or service from accounts, customers, or employees.

Badge

If you like to replace you can use Liquid filters: replace (shopify.dev)

Thanks @Daniel Söderlund 

The sanitize_html doesn’t work because it’s not an html code. But I used:

"{{ticket.description | replace: "'", "/" }}" so that un’altra becomes un/altra with no errors!!!

I used “ instead of ‘ inside the replace function

Thanks!

Userlevel 7
Badge +13

If you like to replace you can use Liquid filters: replace (shopify.dev)

Thanks @Daniel Söderlund 

The sanitize_html doesn’t work because it’s not an html code. But I used:

"{{ticket.description | replace: "'", "/" }}" so that un’altra becomes un/altra with no errors!!!

I used “ instead of ‘ inside the replace function

Thanks!

just one ‘ would break stuff. I though the sanitize_html would replace that as well. oh well good that you found a solution. 

Reply