from object

This block is part of the xml group and was last modified in core v10.4.28.

from object v10.4.28

In pins 2 + flow
  • flow
    flow
  • XML Root Tag required
    value

    The root tag entity of the XML to build (e.g. "user")

  • data required
    object

    Data to build XML from, you could use "@" keys to add attributes.

Out pins 3 + flow
  • flow
    flow
  • success
    condition

    Returns true if we could build XML from given object

  • XML
    value

    If succeeded, returns the XML output as value

  • error
    value

    If not succeeded, returns the error while building XML

Builds an XML string FROM the object : despite the name it serializes, it does not parse. Keys become elements in ALPHABETICAL order (not insertion order), arrays repeat the parent element per item, scalar values are escaped, and nil values emit empty elements; the xml_root pin wraps everything in a root tag after the XML declaration. Falsy data (nil, "", 0, false) serializes as an empty root. success is always true and error is never set; "@" keys become literal elements, NOT attributes.

A typical wiring for from object: a function trigger starts the flow; the flow out pin feeds debug.

Studio canvas example for the from object block: typical wiring for from object.

Version history

Introduced in v10.4.28.


Back to xml Return to the main group to view all sub-groups Back to XML Return to the group to view all blocks within this group