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

Question

Question

Substitute calculation breaks with parenthesis

asked on August 14, 2019

I have a field in forms with the following calculation that is based on a previous single line field.

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(
UnparsedURL, " ", "%20"),
"&", "%26"),
"-", "%2D"),
"'", "%27"),
",", "%2C"),
"(", "%28"),
")", "%29")

 

It works perfectly in Excel, but it shows a blank line in Forms. 

 

If I remove the parenthesis substitutes and have this below, then it works.

 

=SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(SUBSTITUTE(
UnparsedURL, " ", "%20"),
"&", "%26"),
"-", "%2D"),
"'", "%27"),
",", "%2C")

0 0

Answer

SELECTED ANSWER
replied on August 14, 2019 Show version history

Escape the parentheses character(s) with a back slash. For example,

=SUBSTITUTE(Source_Text,"\(","%28")

 

Another option would be to use JQuery's encodeURIComponent method, in which case you don't have to include a substitute for every possible character.

0 0
replied on August 15, 2019

I knew it was something simple. Thanks Jason!

0 0

Replies

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

Sign in to reply to this post.