Articles in this section

base64Decode helper

The base64Decode helper decodes a base64-encoded string into a specified output format. Use it to handle encoded values in API responses, credentials, or record fields. If no format is specified, the output defaults to UTF-8.

Syntax

{{base64Decode base64String "decodeFormat"}}

base64String -- The base64-encoded string to decode. Required. If the input is malformed, the helper throws an error.

decodeFormat -- The output encoding format. Optional. Defaults to "utf8". Accepted values: "utf8", "ascii", "hex", "base64", "binary", "latin1", "ucs2" / "ucs-2", "utf16le" / "utf-16le".

Examples

Decode a base64 field to a readable string

{{base64Decode record.base64EncodedData "utf8"}}

Input: record.base64EncodedData is "U29tZSBlbmNvZGVkIHZhbHVl"
Output: Some encoded value

Decode a base64 string to hexadecimal

{{base64Decode "SGVsbG8gV29ybGQh" "hex"}}

Output: 48656c6c6f20576f726c6421

This is the hex representation of "Hello World!".

Return raw output with triple braces

{{{base64Decode record.base64EncodedData "utf8"}}}

Use triple braces when downstream systems require the exact decoded string without Celigo's automatic formatting or URI encoding.

Usage notes

  • Choose decodeFormat based on how the decoded output will be used: "utf8" for readable text, "hex" for raw byte inspection, and so on.
  • If decodeFormat is omitted, the output defaults to "utf8".
  • If base64String is malformed or the format is unsupported, the helper throws an error. Validate inputs when possible.
  • Use triple braces ({{{ }}}) for raw output and double braces ({{ }}) when Celigo's default formatting is acceptable.