Skip to main content
Solved

Using ' in API ticket.description


Nexus
Contributor
Forum|alt.badge.img
  • Contributor
  • 3 replies

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 

Best answer by Daniel Söderlund

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

View original
Did this topic help you find an answer to your question?

5 replies

Daniel Söderlund
Skilled Expert
Forum|alt.badge.img+14
Nexus wrote:

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


Daniel Söderlund
Skilled Expert
Forum|alt.badge.img+14

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


EthinixSalon
Forum|alt.badge.img+1

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


Nexus
Contributor
Forum|alt.badge.img
  • Author
  • Contributor
  • 3 replies
  • April 26, 2023
Daniel Söderlund wrote:

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!


Daniel Söderlund
Skilled Expert
Forum|alt.badge.img+14
Nexus wrote:
Daniel Söderlund wrote:

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