Skip to main content

Convert text to URL safe text

Text has to abide by certain rules to make it safe for use as a URL, such as within an API call. This Wrk Action will convert any unsafe content in the text into acceptable characters (e.g., %20 instead of a space).

Common use cases​

  • Data manipulation

Application​

  • Text

Inputs (what you have)​

NAMEDESCRIPTIONTYPEREQUIREDEXAMPLE
TextEnter the text to convert into URL safe textTextYesa=b|b=x%2
Characters to ignoreEnter any special characters that should remain unconverted. There is no separator between characters and all characters given will be ignored.TextNo|%

Note: the value of inputs can either be a set value in the configuration of the Wrk Action within the Wrkflow, or a variable from the Data Library. These variables in the Data Library are the outputs of previous Wrk Actions in the Wrkflow.

Outputs (what you get)​

NAMEDESCRIPTIONTYPEREQUIREDEXAMPLE
URL safe textText converted to URL safe textURLYesa%3Db|b%3Dx%2

Outcomes​

NAMEDESCRIPTION
SuccessThis status is selected when the text is successfully converted to URL safe text.
UnsuccessfulThis status is selected in the event of the following scenarios:- There is no text to conside

How it works​

Converts any unsafe characters to their approved encoded equivalents to create a valid URL.

The following characters are considered "safe":

  • Alphabets (A-Z a-z), Digits (0-9), hyphen (-), underscore (_) tilde (~), and dot (.)

    ​

Note: Any other characters will be converted unless entered in the "Characters to ignore" input.

Common characters that require conversion are:

  • ASCII character set , characters in the range 0-31 and 127
  • Reserved Characters, :/?#[]@!$&'()*+,;=
  • Unsafe characters, space<>{}|`^\
  • Characters outside the US-ASCII set

Examples​

1. Text - hello world! URL safe text - hello%20world%21

2. Text - a=b|b=x URL safe text - a%3Db%7Cb%3Dx

3. Text - c=b|b=c%2 Characters to ignore - |% URL safe text - c%3Db|b%3Dc%2

Requirements​

  • N/A