Reuse values and SQL with Parameters and snippets
A Parameter is a named value, and a Snippet is a reusable block of SQL. You define each once and reference it in every pipeline that needs it; when you change it, every pipeline that uses it is flagged stale so you can rerun them. Open them under Data in the left sidebar, on the Parameters tab; Project Admins and Project Editors can create and change them, and Parameters are included on every plan.
To plug them into filters, formulas and SQL rules, see Use a Parameter or Snippet in a filter, formula or SQL.
What a Parameter is
A Parameter is a named value that you plug into conditions, filters, calculations and step values. Instead of typing 100 into ten filters, define Max_Units with value 100 and reference {Max_Units} everywhere; change the threshold once.
| Type | Use for | Example value |
|---|---|---|
| Number | Thresholds, counts, amounts | 100, 0.75 |
| Text | Status values, category names, flags | "Active", "Yes" |
| Date | Cut-off dates, reporting periods | 2026-04-01 |
Reference a parameter with curly braces around its name:
{Max_Units}
A SQL rule like WHERE Discount < {Max_Discount} substitutes the current value at runtime.
What a Snippet is
A Snippet is a reusable block of SQL, such as a fragment, a subquery or a WHERE clause. Embed it with double braces:
SELECT {{column_list}} FROM orders WHERE {{standard_date_filter}}
A snippet's language is always SQL. Snippets can reference parameters, but not other snippets. The Snippets entry in Ask's navigation is unrelated: there, a snippet is a canvas of charts, numbers and notes saved from your chats.
Find Parameters and snippets in the library
Click Data, then the Parameters tab (after Datasets, Connections and Automations). It shows every parameter and snippet for the current project, grouped by category.
| Column | What it shows |
|---|---|
| Name | The identifier used in {name} references |
| Description | What this parameter represents |
| Value | The current value |
| Subtype | Number, Text or Date (parameters); SQL (snippets) |
| Uses | How many pipelines reference it |
- Search parameters finds by name.
- Filter narrows by type (parameters or snippets), subtype (Date, Number, Text, SQL) or category.
- Group by switches between None, Category (the default) and Type.
- The Learn more icon links to help.
Who can manage Parameters and snippets
Creating, editing, duplicating and deleting needs the Manage Parameters and Snippets permission, which Project Admin and Project Editor have. A Project Viewer can read every item, but New Parameter is disabled with "Your role doesn't have permission to perform this action". See Members, roles and custom roles.
Create a Parameter or Snippet
- On the Parameters tab, click New Parameter.
- Choose the Parameter card or the Snippet card.
- Set the Name, Value and, for a parameter, Type (see below).
- Optionally set Category and Description under "More options".
- Click Create Parameter or Create Snippet.
| Field | Required | Notes |
|---|---|---|
| Name | Yes | Starts with a letter or underscore; letters, numbers and underscores; no spaces; up to 100 characters. |
| Type | Parameters only | Number, Text or Date. Can't be changed after creation. |
| Value | Yes | For a parameter, must match the type; dates use a date picker and are stored as YYYY-MM-DD. For a snippet, the SQL code (no language selector); type /param to reference a parameter. |
| Category | No | An existing category, or General. Under "More options". |
| Description | No | Shown in the library and the picker. Under "More options". |
The item appears in the library under its category. Items made here are Project-scoped (there's no Scope field), and names must be unique within their scope. A snippet is referenced with {{name}}. Saving fails with "Snippets cannot reference other snippets" if its code contains another snippet reference in double braces; parameters such as {Max_Units} are fine.
Edit a Parameter and rerun stale pipelines
Click an item to open its detail panel, then Edit (or the edit icon on hover). You can change the value, description and category. The Name is read-only ("Name can't be edited"), and Type and Scope can't be changed. Each change is recorded in the item's history.
Saving changes no data straight away. Every pipeline that uses the item is marked stale, and Mammoth does not rerun them on its own:
- The library highlights stale rows, with a banner such as "2 parameters were updated. Rerun affected pipelines to apply changes." and Rerun stale pipelines.
- The detail panel shows, for example, Stale in 3 pipelines with Rerun.
- The SQL rule, Apply Filter and Data check panels show their own stale banner with Rerun.
A rerun starts from the first task that uses the changed parameter; unchanged upstream tasks are not rerun.
See which pipelines use a Parameter and its history
The detail panel's Uses section lists each pipeline that references the item, as a project, dataset and View path, so you see what a change will affect. Snippets show the same.
Its history shows each change with how long ago it happened, the old value struck through, then the new value. Use it to trace a downstream change back to a specific edit.
Group Parameters into categories
Items go into General by default. Category headings have inline rename and delete icons. To add or manage categories, click + Manage next to the category pills under More options when you create or edit an item; Manage categories names them and gives them colours. Deleting a category moves its items back to General without deleting them.
Duplicate a Parameter or Snippet
- Click the duplicate icon next to Edit in the detail panel (or on hover).
- Duplicate Parameter or Duplicate Snippet opens with
_copyadded to the name, for exampleMax_Units_copy. Change the name or value if you like. - Click Create Duplicate. Nothing is created until you do. A taken name gives "Name already in use".
Delete a Parameter or Snippet
Deleting is immediate and permanent, with no Trash entry and no restore.
- Click the trash icon at the right of the detail panel's header.
- If no pipeline uses it, Delete parameter (or Delete snippet) asks "Are you sure you want to delete" followed by the name, for example
Max_Units, and warns that this can't be undone. - Click Delete.
If a pipeline uses it, Cannot delete parameter (or Cannot delete snippet) says it "is used by pipelines and cannot be deleted", lists each View with its task count, and offers only Close. Remove the references first.
Project and workspace scope
| Project scope | Workspace scope | |
|---|---|---|
| Visible in | This project only | All projects in the workspace |
| Reference syntax | {name} / {{name}} | Same syntax |
| Name uniqueness | Unique within this project | Unique across the workspace |
| Best for | Dataset-specific thresholds, View-specific logic | Shared standards, such as fiscal year start or company-wide thresholds |
New Parameter always creates a Project-scoped item. Workspace-scoped items can exist (for example, created through the API), and you see and reference them like any other. A project-scoped Threshold and a workspace-scoped Threshold can coexist. Scope can't be changed after creation.
Troubleshooting
| Symptom | Cause | Fix |
|---|---|---|
| New Parameter is disabled: "Your role doesn't have permission to perform this action" | You are a Project Viewer. | Ask a Project Admin for the Editor role, or to make the change. |
| Cannot delete parameter | Pipelines still use it. | Remove the references in the listed Views, then delete. |
| "Snippets cannot reference other snippets" | The snippet code has another {{...}} reference. | Paste the other snippet's code instead, or use a parameter. |
| "Name already in use" | The duplicate's name exists. | Choose another name. |
| Data didn't change after you edited a value | Mammoth doesn't rerun stale pipelines on its own. | Click Rerun or Rerun stale pipelines. |
Related
- Use a Parameter or Snippet in a filter, formula or SQL: where parameters plug in.
- Find your way around the Data Library: the tab bar that holds Parameters.
- Get things back from Trash: what Trash covers, and why parameters aren't in it.
- Members, roles and custom roles: the permission to manage them.
Something wrong? support@mammoth.io