DID THIS ARTICLE SOLVE YOUR ISSUE?
Let us know so we can improve!
Let us know so we can improve!
Encodes non-URL components of a string.
This function encodes only characters that follow a URL, such as a query string. To encode an entire string, use encodeURI.
This helper is available in the Winter ’27 release of Marketing Cloud Next.
1{{encodeURIComponent stringToEncode}}| Parameter | Type | Description |
|---|---|---|
stringToEncode | String | Required. The string to encode. |
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{{encodeURIComponent
2 "https://www.example.com/app?firstName=Cruz&lastName=De La Rosa&email=cdelarosa@example.com"
3}}The function returns this URL-encoded string:
1https://www.example.com/app?firstName=Cruz&lastName=De+La+Rosa&email=cdelarosa%40example.com