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

Question

Question

Remove commas and parenthesis from string

asked on July 12, 2019 Show version history

I have a field in a form that I need to ensure does not contain either comma or parenthesis characters. 

 

Example:

Value = Invoice ABC,6AC'4AC

Desired Value = Invoice ABC 6AC 4AC

My thoughts are that after the form has been submitted to run a workflow that Retrieves Business Process Variables and then execute a Pattern Matching activity that strips the , and the ' out of the value.  I'm just not sure how to  construct the pattern in the Pattern Matching activity to do this?  There could be multiple commas or multiple parenthesis or both.

 

0 0

Answer

SELECTED ANSWER
replied on July 15, 2019

[^,)(]+   

Will mark fields as invalid if they contain a comma or parentheses, but you'll probably want to go into the Error Messages setup and write a custom message so people will know what characters are not allowed.

It's probably still a good idea to include some back end cleanup just to be safe.

0 0

Replies

replied on July 12, 2019

You have several options actually.

On the front end, you could add regex to the field(s) to mark those characters as invalid.

On the workflow side

  • A Token Calculator and multiple Substitute to replace specific characters
  • Use the Token Editor with Split functions then "Apply Index" and all values separated by Space
0 0
replied on July 15, 2019

Can you give me an example if I use regex on the front end that would prevent any comma or parentheses?

0 0
SELECTED ANSWER
replied on July 15, 2019

[^,)(]+   

Will mark fields as invalid if they contain a comma or parentheses, but you'll probably want to go into the Error Messages setup and write a custom message so people will know what characters are not allowed.

It's probably still a good idea to include some back end cleanup just to be safe.

0 0
replied on July 15, 2019

Thank you very much!  Works perfectly.  I appreciate it.

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

Sign in to reply to this post.