The base64Decode helper converts a base64-encoded string into a specified output format such as UTF-8, hex, or binary. This is commonly used to handle encoded values in API responses, encrypted credentials, or custom fields in records. If no format is specified, it defaults to decoding as UTF-8.
{{base64Decode base64String "decodeFormat"}}
-
base64String: The base64-encoded input string you want to decode. -
decodeFormat(optional): The output format. Supported values include:"utf8"(default),"ascii","hex","base64","binary","latin1","ucs2"/"ucs-2", or"utf16le"/"utf-16le".
-
Decode base64-encoded record field to UTF-8
{{base64Decode record.base64EncodedData "utf8"}}If
record.base64EncodedDatais"U29tZSBlbmNvZGVkIHZhbHVl", the output will be"Some encoded value". -
Decode base64 string to hexadecimal
{{base64Decode "SGVsbG8gV29ybGQh" "hex"}}This decodes the base64 string
"SGVsbG8gV29ybGQh"to its hex representation:"48656c6c6f20576f726c6421"(which is"Hello World!"in UTF-8). -
Using triple braces to prevent auto-formatting
{{{base64Decode record.base64EncodedData "utf8"}}}Use triple braces to get the raw decoded value without Celigo’s automatic formatting (e.g., quotes or URI encoding).
Tip
-
Always choose the correct
decodeFormatbased on how you intend to use the decoded output—e.g.,"utf8"for readable strings or"hex"for raw byte inspection. -
If omitted, the format defaults to
"utf8", which works for most readable text values. -
Use triple braces (
{{{ }}}) when you need unformatted, raw string output. -
If
base64Stringis malformed or the format is unsupported, the helper may throw an error—validate inputs when possible.