Skip to main content

To YAML Node

To YAML Node Screenshot

Overview

The To YAML Node is used to convert an object into a YAML string. This can be useful when you need to output your data in a YAML format.

Inputs

TitleData TypeDescriptionDefault ValueNotes
ObjectobjectThe object to convert to YAML.(required)

Example 1: Convert an object to YAML

  1. Create an Object Node and set the value to the following:

    {
    "name": "Claude Shannon",
    "occupation": "Computer scientist"
    }
  2. Create a To YAML Node and connect the Object Node to its Object input.

  3. Run the graph. The To YAML Node should output the following YAML string:

    name: Claude Shannon
    occupation: Computer scientist

    To YAML Node Example 1

Error Handling

The To YAML Node will throw an error if the input is not an object.

FAQ

Q: Can I convert an array to YAML?

A: Yes, you can convert an array to YAML. However, you must first convert the array to an object using the Array Node.

Q: Can I convert a string to YAML?

A: No, you cannot convert a string to YAML. The To YAML Node only accepts objects as input.

See Also