> ## Documentation Index
> Fetch the complete documentation index at: https://docs.maia.ai/llms.txt
> Use this file to discover all available pages before exploring further.

# Construct Variant

export const ComponentMetadata = ({warehouses, unsupportedWarehouses = [], componentType, connectionInputs, connectionOutputs}) => {
  const allWarehouses = [...warehouses.map(w => ({
    name: w,
    supported: true
  })), ...unsupportedWarehouses.map(w => ({
    name: w,
    supported: false
  }))];
  return <div style={{
    background: 'var(--colors-background-light, #f9fafb)',
    border: '1px solid var(--colors-border-default, #e5e7eb)',
    borderRadius: '12px',
    padding: '20px 28px',
    marginBottom: '28px',
    boxShadow: '0 1px 4px rgba(0,0,0,0.10)'
  }}>
      <table style={{
    width: '100%',
    borderCollapse: 'collapse'
  }}>
        <tbody>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle',
    width: '180px'
  }}>Project Availability</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>
              <div style={{
    display: 'flex',
    flexWrap: 'wrap',
    gap: '8px'
  }}>
                {allWarehouses.map((w, i) => <span key={i} style={{
    background: w.supported ? '#dcfce7' : '#fee2e2',
    color: w.supported ? '#15803d' : '#b91c1c',
    border: `1px solid ${w.supported ? '#bbf7d0' : '#fca5a5'}`,
    borderRadius: '9999px',
    padding: '3px 12px',
    fontSize: '0.85rem',
    fontWeight: '500',
    whiteSpace: 'nowrap'
  }}>
                    {w.name} {w.supported ? '✅' : '❌'}
                  </span>)}
              </div>
            </td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Component Type</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{componentType}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    paddingBottom: '14px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Inputs</td>
            <td style={{
    paddingBottom: '14px',
    verticalAlign: 'middle'
  }}>{connectionInputs}</td>
          </tr>
          <tr>
            <td style={{
    fontWeight: '600',
    paddingRight: '32px',
    whiteSpace: 'nowrap',
    verticalAlign: 'middle'
  }}>Connection Outputs</td>
            <td style={{
    verticalAlign: 'middle'
  }}>{connectionOutputs}</td>
          </tr>
        </tbody>
      </table>
    </div>;
};

<ComponentMetadata warehouses={["Snowflake"]} unsupportedWarehouses={["Databricks", "Amazon Redshift"]} componentType="Transformation" connectionInputs="Two" connectionOutputs="Unlimited" />

The **Construct Variant** transformation component lets you convert existing rows of data into arrays of key:value pairs. The key:value pairs are then output in a new column as variant-type data. This allows you to store semi-structured data formats like JSON or XML within a relational database.

Each value in the new column takes the form of a Snowflake object. See [OBJECT\_CONSTRUCT](https://docs.snowflake.net/manuals/sql-reference/functions/object_construct.html) for more information.

### Use case

This component can be useful when storing or processing data that doesn't fit into a table structure. For example, you can use it to:

* Store data that doesn't conform to a standard schema, such as patient and treatment data in healthcare settings.
* Store data from multiple sources, such as customer feedback collected from emails, surveys, and social media, regardless of the original format.

***

## Properties

<ResponseField name="Name" type="string" required>
  A human-readable name for the component.
</ResponseField>

{/* <!-- param-start:[columnMappings] | warehouses: [snowflake] --> */}

<ResponseField name="Column Mappings" type="column editor" required>
  Select pairings for **Source** and **Target** columns. In the resulting Key:Value pairs, the Values are taken from the **Source** columns and the Keys are the **Target** column names.

  Click the **Add all** button to automatically populate the **Source** and **Target** columns with all the column names from the input source. You can then selectively edit the list if required, but if you click **Add all** again it will return the list to the default fully populated state, removing any changes you have made.
</ResponseField>

{/* <!-- param-start:[outputSlot] | warehouses: [snowflake] --> */}

<ResponseField name="Output Slot" type="string" required>
  The name of the outputted constructed variant column.
</ResponseField>
