Question

Escape character i Workflow Automation


hi

i am trying to build an automatic flow and use the expression builder to read a value from the last written note.

The text that we are going to get is surrounded by this character "

Can you use excape characters to get the expression builder to understand which character it should, for example, replace?

For example. replace('Testing " if it " works',' " ','*') to replace " with *.

I get an error message that says
Invalid syntax - Missing right parenthesis


14 replies

Userlevel 3
Badge +3

Makes sense! I’ve got this down as a potential enhancement for the expression builder. 

Userlevel 7
Badge +15

@vishal.abraham Thanks for passing this along to the product team. 💪

Badge +2

Opened a case yesterday for similar issue.  Trying to sanitize last name before account creation in AD to remove spaces, dash, single quotes, etc.  Also getting the invalid syntax error.

Userlevel 7
Badge +12

Opened a case yesterday for similar issue.  Trying to sanitize last name before account creation in AD to remove spaces, dash, single quotes, etc.  Also getting the invalid syntax error.

Have you tried using? Powerful Placeholders with Liquid Filters : Freshservice
remove – Liquid template language (shopify.github.io)
strip – Liquid template language (shopify.github.io)
 

Userlevel 7
Badge +12

Opened a case yesterday for similar issue.  Trying to sanitize last name before account creation in AD to remove spaces, dash, single quotes, etc.  Also getting the invalid syntax error.

Have you tried using Liquid Filters ? Introduction – Liquid template language (shopify.github.io)
The Remove and Strip filter. 

Userlevel 7
Badge +12

Opened a case yesterday for similar issue.  Trying to sanitize last name before account creation in AD to remove spaces, dash, single quotes, etc.  Also getting the invalid syntax error.

Tried using Liquid Filters? 

Badge

anyone get a solution on this?

Badge +2

Opened a case yesterday for similar issue.  Trying to sanitize last name before account creation in AD to remove spaces, dash, single quotes, etc.  Also getting the invalid syntax error.

Tried using Liquid Filters? 

I’m not sure what you are suggesting.  I can replace most characters just ASCII Code 39 is the issue because it gets interpreted as a string terminator.   In powershell I could use something like $string.Replace([char]39,””), but there doesn’t seem to be an equivalent.

Badge +2

I tried {{ "e3.result" | replace: “’”, "" }}.  No luck.  Invalid operand.  Then I saw regexreplace is available.  But that doesn’t seem to work either.  I can’t escape the single quote.

So if someone enters O’Grady instead of O`Grady (single quote instead of apostrophe) I can’t clean the string.  Problematic because AD and 365 will accept a userpincipalname or email address with those characters but as you try to push that out to other integrated systems they are often not accepted.

Badge +2

ok so I think my misunderstanding is that Liquid filters can be used in app actions, but they are not accepted in expression builder.

Userlevel 7
Badge +12

ok so I think my misunderstanding is that Liquid filters can be used in app actions, but they are not accepted in expression builder.

I think I got Liquid to work, you like to remove ‘ from a placeholder? 
You shouldn’t use "e3.result" it needs to be just e3.result 

What is your next step b/q you can use Liquid when you add the PH in a note, field or JSON payload. 

 

//Daniel

Badge +2

ok so I think my misunderstanding is that Liquid filters can be used in app actions, but they are not accepted in expression builder.

I think I got Liquid to work, you like to remove ‘ from a placeholder? 
You shouldn’t use "e3.result" it needs to be just e3.result 

What is your next step b/q you can use Liquid when you add the PH in a note, field or JSON payload. 

 

//Daniel

The next step is an expression that builds samaccountname which is then used to verify it does not conflict with an existing user and later to create JSON payloads for proxyaddresses, etc.

Correct trying to remove ‘ from a placeholder.  

Badge +2

If I could use escape from Liquid I could then use replace to get rid of '

escape – Liquid template language (shopify.github.io)

Userlevel 7
Badge +12

If I could use escape from Liquid I could then use replace to get rid of '

escape – Liquid template language (shopify.github.io)

What happens if you use sanitize_html ?

Powerful Placeholders with Liquid Filters : Freshservice

Reply