> ## 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.

# Update Scalar

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", "Databricks", "Amazon Redshift", "Google BigQuery"]} componentType="Orchestration, Test" connectionInputs="One" connectionOutputs="Unlimited" />

The Update Scalar component allows you to change the value of any pipeline variable or project variable during pipeline execution, to a new value decided at the time the component is configured. The value is updated at the point the pipeline reaches this component, meaning that any later components in the pipeline will be executed using the new value.

<Note>
  If you construct a [branching pipeline](/docs/guides/components-overview#connect-components) and add an Update Scalar component to one branch, the value of the variable only changes in that branch; the other branch will use the original value of the variable. In effect, each branch of a complex pipeline has its own "local copy" of the variable, each of which can be updated independently by instances of this component.
</Note>

For a full explanation of variables, read [Project and pipeline variables](/docs/guides/variables).

***

## Properties

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

{/* <!-- param-start:[scalarsToUpdate] | warehouses: [snowflake, databricks, redshift, bigquery] --> */}

<ResponseField name="Variables to update" type="column editor" required>
  In the **Variables to update** dialog, select a variable in the **Name** drop-down and enter a new value in the **Value** column. Click **+** to select additional variables to update.

  The **Value** field allows you to use simple expressions within the field to change the variable value. Some examples of the expressions you can use include:

  * Add a fixed string to the beginning or end of a text variable, for example:

    ```
    STAGE_${table_name}
    ```

    will add the string "STAGE\_" to the front of the text variable `table_name`.

  * Combine (concatenate) two text variables:

    ```
    ${prefix}${table_name}
    ```

  * Perform arithmetic on numeric variables. For example:

    ```
    ${counter + 1}
    ```

    will increment the variable `counter` by one. You must put the mathematical operator *inside* the curly brackets (braces), `{ }`, that surround the variable name. `${counter} + 1` won't produce the expected result.

  * Use a JavaScript expression to convert a text variable to upper case:

    ```
    ${table_name.toUpperCase()}
    ```

  * Use a JavaScript regular expression to replace all characters in a text variable that aren't letters or numbers with an underscore:

    ```
    ${table_name.replace(/[^0-9a-zA-Z]/g, "_")}
    ```

  * Use a JavaScript expression to set a text variable to the current timestamp in ISO 8601 format:

    ```
    ${new Date().toISOString()}
    ```

  * Use a JavaScript expression to set a variable to a timestamp in ISO 8601 that depends on the current date and time, for example the start of the previous day:

    ```
    ${new Date(new Date().setUTCHours(0,0,0,0) - 86400000).toISOString()}
    ```

  These examples can be combined to perform complex variable manipulation. For example:

  ```
  STAGE_${stage_name.toUpperCase()}_TABLE_${table_name.toUpperCase()}
  ```

  <Warning>
    If you enter or calculate a new value of the wrong data type, for example enter non-numeric characters into a variable of type "Number", the component will fail at runtime. This failure will not necessarily cause the pipeline to fail, though you may encounter unexpected results due to the failure to update the variable.
  </Warning>

  Click the **Text mode** toggle at the bottom of the dialog to open a multi-line editor that lets you add items in a single block. For more information, read [Text mode](/docs/guides/components-overview#text-mode).

  To use grid variables, toggle **Use Grid Variable** on at the bottom of the dialog. For more information, read [Grid variables](/docs/guides/grid-variables).
</ResponseField>
