Skip to content

render

render(value, format, pretty?) → string · Format

Serialize a UDM value to a string in the specified format.

  • value (required): UDM value to serialize

  • format (required): "json", "xml", "yaml", "csv"

  • pretty (optional, default false): pretty-print with indentation

utlx
render({name: "Alice"}, "json", true)    // pretty-printed JSON
render({Order: {Id: "1"}}, "xml")        // "<Order><Id>1</Id></Order>"

// Use case: embed XML inside a JSON field (CDATA pattern)
{
  messageId: generateUuid(),
  payload: render($input, "xml")         // XML as a string value
}

Released under AGPL-3.0.