Links

Base64

Know the component and how to use it.
Base64 encodes and decodes from/to fields, payload, and files in base64 string format.
Take a look at the configuration parameters of the component:
  • Operation: defines the operation to be performed (Encode Fields, Encode Payload, Encode File, Decode Fields, Decode Payload, Decode File).
  • JSON Fields: JSON path to be encoded or decoded. The fields must be separated by comma (eg.: field1,field2). This option is valid for the Encode Fields and Decode Fields operations only.
  • Preserve Original: if enabled, the option preserves the original fields and changes prefixes by adding the underline character (_).
  • Payload: field to directly inform the payload that will have its content encoded/decoded (eg: body, data, {{ message.payload }}). This option is valid for the Encode Payload and Decode Payload operations only.
  • Result As File: if enabled, the option saves the encode or decode result in a file. This option is valid for the Encode Payload and Decode Payload operations only.
  • File Name: name of the file to be compressed.
  • Output File Name: name of the output file after a file is encoded/decoded. This option is valid for the Encode File and Decode File operations only.
  • Is Binary: if enabled, the option will expect the payload as a binary file. This option is valid for the Decode Payload operation only.
  • Fail On Error: if the option is enabled, the execution of the pipeline with error will be interrupted; otherwise, the pipeline execution proceeds, but the result will show a false value for the “success” property.
IMPORTANT: The File Name and Output File Name fields must receive different values. If the values are the same, an error will be produced (an exception).
Some parameters above accept Double Braces. Read the article Double Braces to learn more about how this language work.

Messages flow

Input

For the Encode Fields and Decode Fields operations, the component expects to receive a JSON containing the fields configured in the JSON Fields property.
Example:
Configuration
JSON Field = field1,field2
The expected JSON must at least have:
{
"field1": "SOMETHING",
"field2": "SOMETHING"
}
For the Encode Payload and Decode Payload operations, you must configure the Payload field to encode/decode.
Example:
Configuration
Payload = {{ message.field1 }}
The expected JSON must at least have:
{
"field1": "SOMETHING"
}
For the Encode File and Decode File operations, you must configure the file that will be encoded/decoded and the resulting file of this operation.
Example:
File Name = input.csv
Output File Name = outputfile.csv

Output

For the Encode Fields and Decode Fields operations:
{
"field1": "SOMETHING ENCODED/DECODED",
"field2": "SOMETHING ENCODED/DECODED",
"_field1": "ORIGINAL VALUE",
"_field2": "ORIGINAL VALUE",
}
For the Encode Fields and Decode Fields operations, if the input message is preserved:
{
"field1": "SOMETHING ENCODED/DECODED",
"field2": "SOMETHING ENCODED/DECODED",
"_field1": "ORIGINAL VALUE",
"_field2": "ORIGINAL VALUE",
}
For the Encode Payload and Decode Payload operations, if the output is a file:
{
"success": "true",
"fileName": "file.csv"
}
For the Encode Payload and Decode Payload operations, if the output is a string:
{
"success": "true",
"result": "SOMETHING ENCODED/DECODED"
}
For the Encode File and Decode File operations:
{
"success": "true",
"fileName": "file.csv",
"outputFileName": "file.csv"
}