Base64Decode
→ stringDecodes a Base64-encoded string. Only works with values encoded using Platform.Function.Base64Encode() or Base64Encode() — not arbitrary Base64 strings.
Available in:
Email
CloudPage
Automation
Triggered Send
Syntax
Platform.Function.Base64Decode(encodedString[, charset])
1–2 arguments
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
encodedString |
string | Yes | Base64 encoded string to decode |
charset |
string | No | Character set to use when decoding, such as ASCII or UTF-8 |
Description
Decodes a Base64-encoded string back to its original value. Use the optional charset parameter to match the encoding used when the string was encoded.
For a single-argument form without charset control, see Base64Decode() under Global Functions.
Example
var encodedStr = Platform.Function.Lookup("forBase64Info", "ReceiptData", "ReceiptKey", "stringValue");
var decodedStr = Platform.Function.Base64Decode(encodedStr);
Write(decodedStr);