Skip to main content
Question

Escape character i Workflow Automation


Jnstare
Apprentice

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

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

14 replies

vishal.abraham
Skilled Expert
Forum|alt.badge.img+3

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


zachary.king
Skilled Expert
Forum|alt.badge.img+16
  • Skilled Expert
  • 951 replies
  • September 2, 2022

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


Forum|alt.badge.img+2
  • Top Contributor
  • 9 replies
  • September 2, 2022

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.


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

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)
 


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

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. 


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

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? 


Forum|alt.badge.img
  • Contributor
  • 3 replies
  • February 17, 2023

anyone get a solution on this?


Forum|alt.badge.img+2
  • Top Contributor
  • 9 replies
  • March 10, 2023
daniel.soderlund wrote:
timm.green wrote:

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.


Forum|alt.badge.img+2
  • Top Contributor
  • 9 replies
  • March 10, 2023

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.


Forum|alt.badge.img+2
  • Top Contributor
  • 9 replies
  • March 10, 2023

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


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

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


Forum|alt.badge.img+2
  • Top Contributor
  • 9 replies
  • March 15, 2023
Daniel Söderlund wrote:
timm.green wrote:

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.  


Forum|alt.badge.img+2
  • Top Contributor
  • 9 replies
  • March 15, 2023

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

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


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

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