You are viewing limited content. For full access, please sign in.

Question

Question

How can I escape a string token value to be used in webrequest activity as json data

asked on May 5, 2023

If a workflow token %(GetFieldValues_Message) contain a string value captured from a Laserfiche form that contains double quote:

For example:

I love "banana"

 

And I need to pass this token value as part of a json string for Webrequest content body

Example:

{  ID: "1234", Message: "I love \"banana\""}

How can I assign the token value %(GetFieldValues_Message) to the json string with the escape character?

Is there a Workflow activity that can add the escape character to a token value before I assign the token to the json string?

Example:

{  ID: "1234", Message: "%(GetFieldValues_Message)"}

1 0

Replies

replied on December 18, 2024 Show version history

Has someone figured out a way to do this? Perhaps with a C# script?

Using SUBSTITUTE repeatedly in the Token Calculator activity, I can escape the printable characters, but I haven't found a way to escape the non-printable characters backspace, form-feed, newline, carriage-return, and tab.

My Token Calculator expression is 

SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(%(test), "\","\\" ), """","\""" ),  "/", "\/")

 

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.