Flatten Variant
    • Dark
      Light

    Flatten Variant

    • Dark
      Light

    Article Summary

    This article is specific to the following platforms - Snowflake.

    Flatten Variant Component

    'Flattens' (explodes) compound values into multiple rows. When an input column (of Variant type) contains many values, Flatten Variant can separate those values, giving each their own column.

    For this component to be useful, the input data must be condensed in such a way that a single column contains multiple columns worth of data. The expected format is as follows:

    { "<ColumnName>": <Value>, "<ColumnName2>": <Value>", ... }

    For example:

    { "Name": "John Bigs", "Age": 32, "Married": TRUE } 

    In the example above, this single column can be separated into 3 columns named 'Name', 'Age' and 'Married' with respective types VARCHAR, NUMBER, BOOLEAN.

    This component can be used to flatten nested arrays and expose their variables. For a guide on how this works, see the Flattening Nested Arrays page.

    Properties

    PropertySettingDescription
    NameTextThe name of the component on the canvas.
    Column MappingColumn/Property/Type/AliasChoose an input column and a property from it to take. Each property taken creates a column in the output and each row contains values from each property from its respective row in the input data.
    Column FlattensColumn/Property/AliasTake a property from an input column and flatten it such that its values constitute another input column. For example, an array value held as a single string in an input column can be flattened, so long as it adheres to the formatting outlined at the top of this article. Columns defined here can be used in the 'Column Mapping' property.



    Video


    What's Next