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

# Metadata settings

> Settings, options, and behaviors for Metadata in Sift, including supported resource types such as Runs, Campaigns, and Annotations.

export const MintTable = ({columns = [], rows = [], columnWidths = []}) => {
  const pushTextWithLineBreaks = (parts, text, keyBase) => {
    const segments = String(text).split(/\\n|\n/);
    segments.forEach((segment, idx) => {
      if (segment) {
        parts.push(<span key={`${keyBase}-text-${idx}`}>{segment}</span>);
      }
      if (idx < segments.length - 1) {
        parts.push(<br key={`${keyBase}-br-${idx}`} />);
      }
    });
  };
  const parseMarkdown = text => {
    if (text === null || text === undefined) return "";
    const str = String(text);
    const parts = [];
    let lastIndex = 0;
    const pattern = /(`[^`]+`|\*\*[^*]+\*\*|\*[^*]+\*|\[([^\]]+)\]\(([^)]+)\))/g;
    let match;
    while (true) {
      match = pattern.exec(str);
      if (match === null) {
        break;
      }
      if (match.index > lastIndex) {
        pushTextWithLineBreaks(parts, str.substring(lastIndex, match.index), `before-${lastIndex}`);
      }
      const fullMatch = match[0];
      if (fullMatch.startsWith("`") && fullMatch.endsWith("`")) {
        parts.push(<code key={match.index}>{fullMatch.slice(1, -1)}</code>);
      } else if (fullMatch.startsWith("**") && fullMatch.endsWith("**")) {
        parts.push(<strong key={match.index}>{fullMatch.slice(2, -2)}</strong>);
      } else if (fullMatch.startsWith("*") && fullMatch.endsWith("*")) {
        parts.push(<em key={match.index}>{fullMatch.slice(1, -1)}</em>);
      } else if (fullMatch.startsWith("[")) {
        const linkText = match[2];
        const linkUrl = match[3];
        parts.push(<a key={match.index} href={linkUrl} className="text-black-600 dark:text-black-400">
            {linkText}
          </a>);
      }
      lastIndex = pattern.lastIndex;
    }
    if (lastIndex < str.length) {
      pushTextWithLineBreaks(parts, str.substring(lastIndex), `tail-${lastIndex}`);
    }
    if (parts.length > 0) {
      return parts;
    }
    const plainParts = [];
    pushTextWithLineBreaks(plainParts, str, "plain");
    return plainParts.length ? plainParts : str;
  };
  const safeColumns = Array.isArray(columns) ? columns : [];
  const safeRows = Array.isArray(rows) ? rows : [];
  const safeColumnWidths = Array.isArray(columnWidths) ? columnWidths : [];
  const hasColumnWidths = safeColumnWidths.some(w => w !== null && w !== undefined && w !== "");
  const toCssWidth = width => typeof width === "number" ? `${width}px` : String(width);
  const getColumnStyle = idx => {
    const rawWidth = safeColumnWidths[idx];
    if (rawWidth === null || rawWidth === undefined || rawWidth === "") {
      return undefined;
    }
    const width = toCssWidth(rawWidth);
    return {
      width,
      minWidth: width
    };
  };
  const containerStyle = hasColumnWidths ? undefined : {
    overflowX: "auto"
  };
  const tableStyle = hasColumnWidths ? {
    tableLayout: "fixed",
    width: "100%"
  } : {
    width: "max-content",
    minWidth: "100%"
  };
  if (!Array.isArray(columns) || !Array.isArray(rows) || !Array.isArray(columnWidths)) {
    console.warn("MintTable received invalid props:", {
      columns,
      rows,
      columnWidths
    });
  }
  if (!safeColumns.length && !safeRows.length) {
    return null;
  }
  return <div className="mint-table-container" style={containerStyle}>
      <table style={tableStyle}>
        {hasColumnWidths && <colgroup>
            {safeColumns.map((_, idx) => {
    const style = getColumnStyle(idx);
    return <col key={idx} style={style} />;
  })}
          </colgroup>}
        <thead>
          <tr>
            {safeColumns.map((col, idx) => <th key={idx} className="text-left" style={getColumnStyle(idx)}>
                <b>{parseMarkdown(col)}</b>
              </th>)}
          </tr>
        </thead>
        <tbody>
          {safeRows.map((row, rIdx) => {
    const safeRow = Array.isArray(row) ? row : [];
    return <tr key={rIdx}>
                {safeRow.map((cell, cIdx) => <td key={cIdx} style={getColumnStyle(cIdx)}>
                    {parseMarkdown(cell)}
                  </td>)}
              </tr>;
  })}
        </tbody>
      </table>
    </div>;
};

Metadata in Sift allows organizations to define structured key-value pairs that can be applied to any supported resource in the workspace, creating a consistent taxonomy for organizing, categorizing, and filtering data.

Each Metadata key is defined once at the organization level and bound to a specific data type, ensuring values are used consistently across projects while enabling advanced search and filtering.

## Resources that support Metadata

The following Sift resources support user-defined Metadata:

* <Icon icon="stopwatch" /> Runs,
* <Icon icon="cube" /> Assets,
* <Icon icon="note-sticky" /> Annotations,
* <Icon icon="code-simple" /> Rules,
* <Icon icon="list-check" /> Reports,
* <Icon icon="file-lines" /> Report Templates,
* <Icon icon="objects-column" /> Campaigns,
* <Icon icon="waves-sine" /> Calculated Channels, and
* <Icon icon="function" /> User-defined Functions.

## Settings

The following table describes the settings available when creating a Metadata key.

<MintTable
  columns={['Setting', 'Description']}
  columnWidths={['25%', '75%']}
  rows={[
['Name', 'The name of the Metadata key.'],
['Type', 'The data type for the Metadata key. Cannot be changed after the key is created. See [Data types](#data-types) for supported types.'],
]}
/>

## Data types

Metadata values support the following data types.

<MintTable
  columns={['Type', 'Description', 'Example']}
  columnWidths={['15%', '45%', '40%']}
  rows={[
['String', 'Text values for categorical data', '`Production`, `Test Phase 1`, `Vehicle_001`'],
['Number', 'Numeric values (integers and decimals)', '`1.5`, `42`, `100.25`, `-273.15`'],
['Boolean', 'True/false values for binary classification', '`true`, `false`'],
]}
/>

## Behavior

The following table describes known constraints and behaviors to be aware of when working with Metadata in Sift.

<MintTable
  columns={['Limitation', 'Description']}
  columnWidths={['25%', '75%']}
  rows={[
['Type immutability', 'Once a Metadata key is created, its data type cannot be changed.'],
['Value consistency', 'All values for a given key must match the key\'s defined data type.'],
['Organization scope', 'Metadata keys are shared across the entire organization.'],
['Uniqueness', 'Each Sift resource can only store one Metadata value per key.'],
['Boolean values', 'Adding values to boolean keys is not supported. Boolean keys are limited to `true` and `false`.'],
['Deletion', 'A Metadata key can only be deleted if it is not associated with any resources. Deleting a Metadata key permanently removes it from all resources where it is applied. This action cannot be undone.'],
['Archiving', 'Metadata keys and their values can be archived to remove them from active use without permanently deleting them.'],
]}
/>
