🚀 Welcome to MDriven Learn –  MDriven is now on Discord!  Don’t miss the latest Release Notes.
OCLOperators Base64ToString
This page was created by Stephanie on 2025-01-08. Last edited by Wikiadmin on 2026-07-29.

You can use Base64ToString in OCL to decode a Base64-encoded string as UTF-8 text, for example when an external system provides text in Base64 format.

Syntax

base64String->Base64ToString

Apply the operator to a string that contains Base64 text. The result is the decoded, human-readable string.

Expression part Meaning
base64String The string containing the Base64-encoded value.
->Base64ToString Decodes that value and interprets the decoded bytes as UTF-8 text.

Test the expression in the Debugger

You can verify a Base64 value before using it in a ViewModel expression.

  1. Open the OCL evaluator in the Debugger.
  2. Enter a Base64 string literal followed by ->Base64ToString.
  3. Evaluate the expression and inspect the returned text.
'TURyaXZlbiBEZXNpZ25lcg=='->Base64ToString

This returns:

MDriven Designer

Decode a model attribute

Use the operator on an attribute when that attribute stores Base64 text.

For example, if Customer.Notes contains a Base64-encoded note, evaluate:

self.Notes->Base64ToString

The result is the original UTF-8 text of the note. Here, self is the current Customer object.

Use with Base64 encoding

Use Base64ToString to reverse a value encoded with StringToBase64. This pairing is useful when you need to send UTF-8 text as Base64 and later read the original text again.

For example, the following encoded value decodes back to the original text:

Base64 value Expression Result
TURyaXZlbiBEZXNpZ25lcg== 'TURyaXZlbiBEZXNpZ25lcg=='->Base64ToString MDriven Designer

Input requirements

The receiver must contain a Base64-encoded representation of UTF-8 text. Use this operator for text values, not as a substitute for handling binary data.

See also