Skip to main content
All CollectionsWrk Action LibraryText
Convert text to URL safe text
Convert text to URL safe text
Wrk Product avatar
Written by Wrk Product
Updated over a week ago

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)

NAME

DESCRIPTION

TYPE

REQUIRED

EXAMPLE

Text

Enter the text to convert into URL safe text

Text

Yes

a=b|b=x%2

Characters to ignore

Enter any special characters that should remain unconverted. There is no separator between characters and all characters given will be ignored.

Text

No

|%

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)

NAME

DESCRIPTION

TYPE

REQUIRED

EXAMPLE

URL safe text

Text converted to URL safe text

URL

Yes

a%3Db|b%3Dx%2

Outcomes

NAME

DESCRIPTION

Success

This status is selected when the text is successfully converted to URL safe text.

Unsuccessful

This 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

Did this answer your question?