Skip to main content
Question

Expression: Replace language specific characters


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

Hello, 

I’m almost sure I have read on this forum how to replace all non a to z characters in a placeholder but I can’t find it. Could have been using Liquid Filters. 

I have created a Liquid Filter to do it but I need to set a field and using the Liquid Filter in the field isn’t working. Same works fine when I use it in a note. 

 

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

Forum|alt.badge.img+1

Daniel - Can you clarify with more details? Are you trying to replace a field with a specific value. Can you give an example?


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

Daniel - Can you clarify with more details? Are you trying to replace a field with a specific value. Can you give an example?

I’m trying to create a valid e-mail adress. 

so from Daniel Söderlund to daniel.soderlund


Forum|alt.badge.img+1

You can use the liquid filter

{{ticket.ri_51_cf_employee_first_name | first}} {{ticket.ri_51_cf_employee_last_name }}@domain.com

Most of the Liquid filters here are supported

 

https://support.freshservice.com/en/support/solutions/articles/50000004100-expression-builder-node


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

You can use the liquid filter

{{ticket.ri_51_cf_employee_first_name | first}} {{ticket.ri_51_cf_employee_last_name }}@domain.com

Most of the Liquid filters here are supported

 

https://support.freshservice.com/en/support/solutions/articles/50000004100-expression-builder-node

When do it like this 

We get this in the field "tempdata": "Liquid error: no implicit conversion of nil into String.Liquid error: no implicit conversion of nil into String@domain.com”

If I use the same in a note it shows OK 

 


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

@zachary.king do you have any good solution, it’s for creating UPN/e-mail 


zachary.king
Skilled Expert
Forum|alt.badge.img+16
Daniel Söderlund wrote:

@zachary.king do you have any good solution, it’s for creating UPN/e-mail 

I’m sorry, I don’t. If the field is being filled with that Liquid language error I would suggest taking it to support@freshservice.com. My guess is that when it passes the value stored in the placeholder it is parsing it incorrectly for the textbox field type. We think it wouldn’t matter since when you use the placeholder in a note it is parsing and setting the value as a string correctly. So I bet it is an issue with the textbox field and not the value that is being stored for the placeholder. Does it work if you change the type of the field to a paragraph field instead?


Forum|alt.badge.img+11
  • Skilled Expert
  • May 1, 2023

Hi @Daniel Söderlund 

I’m surprised there’s not something pre-canned for converting (or accepting) some non-English characters on the Exchange (or whatever brand email) server….. 

 

Focusing on the error, could you exclude Nils?

 

We get this in the field "tempdata": "Liquid error: no implicit conversion of nil into String.Liquid error: no implicit conversion of nil into String@domain.com” If I use the same in a note it shows OK 

 

And you can’t use the Note field to create an email address, right?


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

@zachary.king do you have any good solution, it’s for creating UPN/e-mail 

I’m sorry, I don’t. If the field is being filled with that Liquid language error I would suggest taking it to support@freshservice.com. My guess is that when it passes the value stored in the placeholder it is parsing it incorrectly for the textbox field type. We think it wouldn’t matter since when you use the placeholder in a note it is parsing and setting the value as a string correctly. So I bet it is an issue with the textbox field and not the value that is being stored for the placeholder. Does it work if you change the type of the field to a paragraph field instead?

Maybe a idea to try a paragrah field. 

 

BrynCYDEF wrote:

Hi @Daniel Söderlund 

I’m surprised there’s not something pre-canned for converting (or accepting) some non-English characters on the Exchange (or whatever brand email) server….. 

 

Focusing on the error, could you exclude Nils?

 

We get this in the field "tempdata": "Liquid error: no implicit conversion of nil into String.Liquid error: no implicit conversion of nil into String@domain.com” If I use the same in a note it shows OK 

 

And you can’t use the Note field to create an email address, right?

The error points to the PH is empty. We have the exakt same Liquid filter in a note and WR node and it works just fine. 

What I wished is to do is to use expression node. But LF and the expression node do not work that well. 

 


zachary.king
Skilled Expert
Forum|alt.badge.img+16
Daniel Söderlund wrote:
zachary.king wrote:
Daniel Söderlund wrote:

@zachary.king do you have any good solution, it’s for creating UPN/e-mail 

I’m sorry, I don’t. If the field is being filled with that Liquid language error I would suggest taking it to support@freshservice.com. My guess is that when it passes the value stored in the placeholder it is parsing it incorrectly for the textbox field type. We think it wouldn’t matter since when you use the placeholder in a note it is parsing and setting the value as a string correctly. So I bet it is an issue with the textbox field and not the value that is being stored for the placeholder. Does it work if you change the type of the field to a paragraph field instead?

Maybe a idea to try a paragrah field. 

Give this a shot and let us know what you find out. I would be interested to see if it is strictly related to a “Text” field.


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

@zachary.king do you have any good solution, it’s for creating UPN/e-mail 

I’m sorry, I don’t. If the field is being filled with that Liquid language error I would suggest taking it to support@freshservice.com. My guess is that when it passes the value stored in the placeholder it is parsing it incorrectly for the textbox field type. We think it wouldn’t matter since when you use the placeholder in a note it is parsing and setting the value as a string correctly. So I bet it is an issue with the textbox field and not the value that is being stored for the placeholder. Does it work if you change the type of the field to a paragraph field instead?

Maybe a idea to try a paragrah field. 

Give this a shot and let us know what you find out. I would be interested to see if it is strictly related to a “Text” field.

I got the same 

 


zachary.king
Skilled Expert
Forum|alt.badge.img+16

So what happens if you access the placeholder value in an API request? Can you update the ticket TempData field with the value using the Freshservice API and the placeholder from the expression node? I hope I am understanding your use case correctly.


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

So what happens if you access the placeholder value in an API request? Can you update the ticket TempData field with the value using the Freshservice API and the placeholder from the expression node? I hope I am understanding your use case correctly.

Yes using API works with the same PH/LF but that is another thing that could wrong and if the customer maxes out the API it will fail.

Best of worlds would been to use the expression node. 


Forum|alt.badge.img+2
  • Contributor
  • February 24, 2025

I know this topic is a bit old but the liquid error is caused by not putting quotes around the items you want to replace and having too many replace filters on one variable. This overall might be an issue with the way their system is processing liquid filters as this isn’t the first time I seen it output an error when using too many.

You can see exactly what is happening in a Expression builder. 
{{name | downcase | replace: ö,o}}

Ends up looking for two variables, name and ö

 

If you do {{name2 | downcase | replace: "ö","o"}} it will see it properly and replace accordingly. 

 

But things started to get a bit weird when you add more than two replaces onto a variable. It happens whether downcase is in front or  at the end.

 Here is what I tried where name2 = ÄÖÜß

{{name2 | downcase | replace: "ö","o"}}
{{name2 | downcase | replace: "ö","o" | replace: "ü","u"}}
{{name2 | replace: "ö","o" | replace: "ü","u" | downcase}}
{{name2 | replace: "ö","o" | replace: "ä","a"| replace: "ü","u" }}
{{name2 | replace: "ö","o" | replace: "ü","u" | replace: "ß","ss"| replace: "ü","u"|  downcase}}
{{name2 | downcase | replace: "ö","o" | replace: "ü","u" | replace: "ß","ss"| replace: "ü","u"}}

 

Trying to reproduce this in a Note just brings up Note Given hence why I am using Expression Node.

 

Also, There is also an empty remove that then end of your statement too.

 


Forum|alt.badge.img+2
  • Contributor
  • February 24, 2025

While doing some additional testing, I was able to find out that You can do multiples past three but something must have been weird with what I was using earlier for those last three lines. Instead of notepad I used google Docs to create what to paste into Expression builder. Edit: Seems that if you but the Pipe | character too close to another filter, it throws an liquid error. Such as  | replace: "ö","o"|  or  | replace: "ö","o"}  
By adding some additional spaces I was able to get this to work too. 

So this will be able to work for you if you replace the Umlaut characters to what you are need specifically. 

The code if anyone needs it. 
{{ firstname | downcase | replace: "ä", "ae" | replace: "ö", "oe" | replace: "ü", "ue" | replace: "Ä", "Ae" | replace: "Ö", "Oe" | replace: "Ü", "Ue" | replace: "ß", "ss" | replace: "é", "e" | replace: "è", "e" | replace: "ê", "e" | replace: "ë", "e" | replace: "É", "E" | replace: "È", "E" | replace: "Ê", "E" | replace: "Ë", "E" | replace: "à", "a" | replace: "â", "a" | replace: "á", "a" | replace: "å", "a" | replace: "À", "A" | replace: "Â", "A" | replace: "Á", "A" | replace: "Å", "A" | replace: "ç", "c" | replace: "Ç", "C" | replace: "ñ", "n" | replace: "Ñ", "N" | replace: "ì", "i" | replace: "í", "i" | replace: "î", "i" | replace: "ï", "i" | replace: "Ì", "I" | replace: "Í", "I" | replace: "Î", "I" | replace: "Ï", "I" | replace: "ò", "o" | replace: "ó", "o" | replace: "ô", "o" | replace: "õ", "o" | replace: "ø", "o" | replace: "Ò", "O" | replace: "Ó", "O" | replace: "Ô", "O" | replace: "Õ", "O" | replace: "Ø", "O" | replace: "ù", "u" | replace: "ú", "u" | replace: "û", "u" | replace: "Ù", "U" | replace: "Ú", "U" | replace: "Û", "U" }}.{{ lastname | downcase | replace: "ä", "ae" | replace: "ö", "oe" | replace: "ü", "ue" | replace: "Ä", "Ae" | replace: "Ö", "Oe" | replace: "Ü", "Ue" | replace: "ß", "ss" | replace: "é", "e" | replace: "è", "e" | replace: "ê", "e" | replace: "ë", "e" | replace: "É", "E" | replace: "È", "E" | replace: "Ê", "E" | replace: "Ë", "E" | replace: "à", "a" | replace: "â", "a" | replace: "á", "a" | replace: "å", "a" | replace: "À", "A" | replace: "Â", "A" | replace: "Á", "A" | replace: "Å", "A" | replace: "ç", "c" | replace: "Ç", "C" | replace: "ñ", "n" | replace: "Ñ", "N" | replace: "ì", "i" | replace: "í", "i" | replace: "î", "i" | replace: "ï", "i" | replace: "Ì", "I" | replace: "Í", "I" | replace: "Î", "I" | replace: "Ï", "I" | replace: "ò", "o" | replace: "ó", "o" | replace: "ô", "o" | replace: "õ", "o" | replace: "ø", "o" | replace: "Ò", "O" | replace: "Ó", "O" | replace: "Ô", "O" | replace: "Õ", "O" | replace: "Ø", "O" | replace: "ù", "u" | replace: "ú", "u" | replace: "û", "u" | replace: "Ù", "U" | replace: "Ú", "U" | replace: "Û", "U" }}@{{domain}}

I asked an AI to spit out an array of special characters so I am not sure if this is all the characters you were looking for. 


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

It’s the way I do it as well 


Reply