DocsWorkflowsComponentsDatadata:document:render

data:document:render

Writes a keyed list of items out as a document in one of the supported formats. Selection and patching are the pair for editing a document that already exists, while this one builds a document from data that never was one, which is what a workflow needs once it has assembled the entries itself. Every key and value is escaped for the format being written, so a value holding a separator, a quote, a backslash, or a line break survives a round trip.

Options

NameTypeDescription
formatstringThe output format, one of pairs, json, ios and android
items[]map[string]anyThe entries written to the document, in order
keystringThe item field holding each entry key, as a dotted path
valuestringThe item field holding each entry value, as a dotted path
nestedboolExpands a dotted key into nested json objects
indentintThe json indent width, zero for one compact line

Outputs

NameTypeDescription
body[]byteThe rendered document bytes
contentstringThe rendered document as text
content_base64stringCarries the exact rendered bytes to a later action

Example

name: Render document entries
actions:
  - name: rendered
    component: data:document:render
    vars:
      format: json
      nested: true
      indent: 2
      items: "{{ var.entries }}"

outputs:
  content: "{{ rendered.content }}"
  content_base64: "{{ rendered.content_base64 }}"