Formula - base64encode
The base64encode
Formula in Nodinite lets you encode any string from message body, context, or even nested formulas to base64. This page provides a clear, step-by-step guide with practical examples, so you can quickly master base64 encoding for your integration needs.
✅ Encode text to base64 from message body or context
✅ Use with nested formulas for advanced scenarios
✅ Support for character encoding (e.g., UTF-8, ISO-8859-1)
What is the base64encode formula?
The base64encode
function encodes a string to base64 format. You can use it on message body, context, or the result of another formula. Optionally, specify a character encoding.
How does it work?
Each example below is structured in three clear steps:
- Input – The data or context you start with
- Formula – The base64encode expression you use
- Result – The output you get
Examples
Example 1: Encode text from message body
Input:
Nodinite
Formula:
base64encode(body)
Result:
Tm9kaW5pdGU=
Encodes the message body to base64
Example 2: Encode text with ISO-8859-1 encoding
Input:
Skellefteå
Formula:
base64encode(body, 'iso-8859-1')
Result:
U2tlbGxlZnRl5Q==
Encodes the message body using ISO-8859-1 encoding
Example 3: Encode text with UTF-8 encoding
Input:
Skellefteå
Formula:
base64encode(body, 'utf-8')
Result:
U2tlbGxlZnRlw6U=
Encodes the message body using UTF-8 encoding
Example 4: Encode text from context value
Input:
Simple
Formula:
base64encode(context('id'))
Result:
U2ltcGxl
Encodes the context value to base64
Example 5: Encode text from nested formula result
Input:
[ { "name": "Hello" }, { "name": "World" } ]
Formula:
base64encode(jsonpath('$..name',body))
Result:
SGVsbG8=, V29ybGQ=
Encodes each name returned by the jsonpath function to base64
Usage Tips
- Use with any Content that returns text
- Works with jsonpath, xpath, or other formula functions
- Only use on small messages—this function loads the entire message into RAM
- Optionally specify a character encoding (see List of encodings)
Next Step
Add or manage Search Fields
Add or manage Log Views