Description
Many times string type variables include "special characters", where these types of characters are not accepted as valid input data in various systems. This article will show how you can remove special characters from a string-type variable.
Prerequisites
You must have 2 variables of type string — one with the string that has the special characters and another one to receive the string without special characters.
Instructions
1. Select the Execute JS code activity from Studio Pro
2. Execute the following JavaScript statement:
StringWithoutSpecialCharacters = StringWithSpecialCharacters.replace(/[^a-zA-Z0-9 ]/g, '');
The resulting workflow must look like this:
In this way, the new string type variable contains only valid characters:
Note that all special characters have been removed.