DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
Converts a string to a format that is safe to use in a URL.
This function encodes an entire string. To encode only a query string that follows a URL, use encodeURIComponent.
This helper is available in the Winter ’27 release of Marketing Cloud Next.
1{{encodeURI stringToEncode onlySpaces=true|false}}| Parameter | Type | Description |
|---|---|---|
stringToEncode | String | Required. The string to encode. |
onlySpaces | Boolean | If true, encodes spaces as %20 and ignores other characters. If false, encodes all characters that aren’t safe to use in URLs. The default value is false. |
The function returns the URL-encoded string.
This example encodes a string of text so that it’s safe to include in a URL, converting all spaces and special characters.
1{{encodeURI "Sample Text: example" onlySpaces=false}}The function returns this URL-encoded string:
1Sample+Text%3a+example