Question

Expression: Replace language specific characters

  • 25 April 2023
  • 12 replies
  • 279 views

Userlevel 7
Badge +13

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. 

 


12 replies

Badge +1

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

Userlevel 7
Badge +13

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

Badge +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

Userlevel 7
Badge +13

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 

 

Userlevel 7
Badge +13

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

Userlevel 7
Badge +16

@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?

Userlevel 6
Badge +11

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?

Userlevel 7
Badge +13

@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. 

 

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. 

 

Userlevel 7
Badge +16

@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.

Userlevel 7
Badge +13

@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 

 

Userlevel 7
Badge +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.

Userlevel 7
Badge +13

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. 

Reply