Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 19 additions & 1 deletion layouts/shortcodes/synthetics-variables.en.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,4 +26,22 @@ To create a local variable, click **+ All steps > Variables**. You can select on
{{ result-id }}
: Injects the Result ID of your test run.

To obfuscate local variable values in test results, select **Hide and obfuscate variable value**. Once you have defined the variable string, click **Add Variable**.
To obfuscate local variable values in test results, select **Hide and obfuscate variable value**. After you have defined the variable string, click **Add Variable**.

### Apply filters to variable values

When you reference a variable, you can transform its resolved value by appending a filter with a pipe (`|`). Use the syntax {{ VARIABLE_NAME | filter }} anywhere a variable is accepted, such as the URL, request body, headers, and assertions. The following filters are available:

{{ VARIABLE_NAME | urlEncode }}
: URL-encodes the variable's value. For example, `hello world` becomes `hello%20world`.

{{ VARIABLE_NAME | urlDecode }}
: URL-decodes the variable's value. For example, `hello%20world` becomes `hello world`.

{{ VARIABLE_NAME | base64Encode }}
: Base64-encodes the variable's value. For example, `hello` becomes `aGVsbG8=`.

{{ VARIABLE_NAME | base64Decode }}
: Base64-decodes the variable's value. For example, `aGVsbG8=` becomes `hello`.

Filters apply to both local and global variables. You can apply one filter per reference, and filter names are case-sensitive.
Loading