Metabase actions for write-back forms and workflows

Metabase actions let trusted users update database records from dashboards or public forms. This page covers supported databases, how actions attach to models, write permissions and the controls to put around them.

On this page

Metabase actions for write-back forms: what they do and when to use them

Metabase actions let people update records from a dashboard or a shared form instead of exporting data to another tool. An action is parameterized SQL that writes back to the database, and it can be attached to a dashboard button or used to generate a form that can be shared publicly. Actions are available only for PostgreSQL and MySQL, so a team on another database should settle that question before anything else. Decide early whether write-back is the right pattern at all. If a workflow needs approvals, validation across several systems, audit trails owned by an application, or a user experience that goes beyond a form, a purpose-built admin application may be the safer choice. Metabase's own documentation on editable tables makes a similar point about when an admin app is the better fit.

Actions are added to a model, but they run against the raw tables behind that model. That distinction matters for design: the form a user sees may show a clean, filtered view, while the statement that changes data targets the underlying table and its columns. Map each action to the exact tables and columns it touches, and confirm with your database team which constraints, triggers and default values will apply when a form submits. Metabase suggests a separate metabase_actions database role with write access only to the tables used for actions or editable tables. Confirm how that role is created and scoped in your environment against the Metabase database users documentation, since the grants depend on your database engine and your own security policy.

How a Metabase action reaches your database

The request starts with a user on a dashboard button or a public form who enters values. Metabase fills the parameters into the action's SQL and sends the statement over a database connection, so the write runs on the raw table behind the model. The trust boundary sits between the Metabase application and the database, and the role that connection uses decides what the action can change. Check that role's grants first, because Metabase suggests a separate metabase_actions role with write access only to the tables actions need.

Values flow from a user through Metabase's action SQL into a write on the raw table.

How actions attach to models and raw tables

An action is created against a model, but the SQL it contains runs on the raw tables that model is built from. Metabase does not rewrite the statement to go through the model's query, so the author must know the underlying table names, column names, data types and constraints. A model that renames or hides columns can still look clean in the interface while the action statement references the original physical names. Treat the action as code that touches production tables, and review it the way you would review a stored procedure.

  • Physical names: Write statements against the real schema, not the model's display labels.
  • Column types: Confirm how parameter values are cast so that dates, numbers and text land in the right columns.
  • Constraints: Check unique keys, foreign keys and not-null columns, since a failed write surfaces as a database error.
  • Schema changes: A renamed or dropped column breaks the action without touching the model, so add it to your change review.
  • Supported databases: Actions are available only for PostgreSQL and MySQL, so confirm your source database before designing around this.

Before building, ask the data owner to confirm the schema for each table the action writes to, including any triggers that run on insert or update.

Configuration options and when each fits

This table compares the main choices for write-back: dashboard button actions, generated forms, public forms and the database account each one runs under. Read each row for when the option fits and what it exposes, then decide how much write access each path should carry.

OptionWhen it fitsWhat it exposesControls to add
Dashboard button action for internal staffTrained staff update or flag records while reviewing a dashboard they already have access toAnyone with permission to run the action can change the underlying rows it writes toRestrict who can run the action, keep the SQL parameterized, and log who ran it
Generated form for structured data entryStaff add or edit records through a fixed set of fields with validationForm fields become write parameters, so field types and allowed values define what can be writtenLimit fields to what is needed, validate inputs in the SQL, and test with bad values
Public shared formOutside parties submit data, such as a request or intake record, with no Metabase accountAnyone with the link can submit, so the table accepts writes from unauthenticated usersWrite to a staging table, avoid exposing other columns, rate limit where possible and review submissions before use
Dedicated metabase_actions database roleAny action or editable table in production, where write rights should be limited to named tablesWrite rights cover only the tables granted to that role, and a compromise of the role affects only those tablesGrant write access per table, avoid superuser rights, and rotate the credential like other service accounts
Reusing an application accountA quick proof of concept on a non-production databaseThe action inherits every privilege of the application, including tables the action never needsReplace with a dedicated role before production; confirm with your DBA which privileges the account holds

Setting up actions safely in six steps

This sequence takes a self-hosted Metabase from a plain database connection to a tested write-back action with a restricted role, a visible audit trail and a confirmed failure path, so each control is proven before people rely on it.

  1. Confirm PostgreSQL or MySQL as the application database

    The platform team checks which database holds Metabase's own application data. Actions are available only for PostgreSQL and MySQL, and the docs recommend PostgreSQL for production, while the embedded H2 database is meant for demos. Confirm the application database and the Metabase version against the upgrade and migration notes before you build anything on top of it. Check: the admin settings or deployment configuration names the PostgreSQL or MySQL instance, and a test write from a non-production Metabase is accepted by that same target database type.

  2. Create a separate metabase_actions database role

    A database administrator creates a dedicated role, suggested by Metabase as metabase_actions, and grants write access only to the tables the action will touch or the editable tables it needs. Do not reuse the role Metabase uses to read data for analysis, and do not grant schema-wide or administrative privileges. Ask your database team to confirm the grants with the Metabase database users and privileges documentation. Check: the role can insert or update the named tables, and a query against any other table in the same database is denied.

  3. Write a parameterized SQL action on a test copy

    An analyst or engineer writes the action as parameterized SQL that writes to the database, using named parameters rather than string concatenation, so user input is passed as values. Run it against a non-production copy of the database that has the same schema and the metabase_actions role. Include a condition that limits the update to the intended rows, such as a record identifier. Check: the action changes only the expected test rows, and an input with an unexpected identifier changes nothing.

  4. Attach the action to a model and dashboard

    Actions must be added to a model, but they run against the raw tables behind that model, so the builder should confirm which tables the model reads and matches them to the role's grants. Attach the action to a dashboard button or generate a form from it, and decide whether the form will be shared publicly. Public forms widen who can reach the write path, so most teams keep them internal first. Check: the button or form appears on the intended model in a test dashboard, and the parameters map to the fields users will see.

  5. Restrict who can run the action

    A Metabase administrator sets permissions so only the groups that need the write can run it, using the group and collection permissions your organization already uses for other content. Review whether any public or guest access exposes the action and whether the form can be reached without signing in. Confirm the permission model with the groups documentation before rollout. Check: a user outside the approved group sees no run option, and an approved user can run it in the test environment.

  6. Verify the write, the audit trail and the failure path

    The team runs three checks in the test environment. First, confirm the intended row changed in the database and nothing else did. Second, confirm the run is recorded in the logs or audit data your Metabase edition provides, and that you can tell who ran it and with which inputs; confirm the exact audit detail for your edition with Metabase before relying on it. Third, submit invalid input and a revoked-permission user to confirm the action fails cleanly, returns an error and leaves the data unchanged. Only after all three pass should the action move to production.

Write permissions and controls to put around actions

Actions change data, so the database role, the group permissions, the form exposure and the SQL itself all need the same scrutiny as any other write path. The cards below cover the controls that sit around an action, in the order most teams should design them. Confirm each control against your Metabase plan and your database before rollout.

Use a dedicated least-privilege database role

Metabase suggests a separate metabase_actions role with write access only to the tables used by actions or editable tables. Keep it separate from the role that runs read-only analytics queries, so a dashboard user never inherits write rights by accident. Grant INSERT, UPDATE or DELETE only on the specific tables and columns each action needs. Review the role's grants whenever an action is added or retired.

Database roles docs

Restrict who can run actions

Action visibility and execution follow Metabase group permissions, so decide which groups can see and run each action before attaching it to a dashboard button or form. Keep write actions away from broad groups such as All Users. Test the permissions with a non-admin account, because administrators see more than most users. Document the group that owns each action so access reviews have a clear answer.

Limit public forms for writes

Public forms let anyone with the link submit data to your database without signing in, which is a different risk from an internal form. Avoid public write forms unless a security review has covered who can reach the link, what fields accept input and how spam or abuse would be detected. If you must expose one, keep its columns narrow and its role limited to inserts into a staging table. Confirm how sharing settings apply on your version.

Validate input in parameterized SQL

Actions run SQL with parameters, so write every statement with bound parameters and never concatenate user input into the text. Add database constraints such as NOT NULL, check constraints and foreign keys, since they hold even when a form is misused. Define field types and required fields in the action so bad values fail before they reach the table. Test edge cases such as empty values, oversized text and unexpected characters during the build.

Log and review every write

Decide how each write is recorded before the action goes live. Some teams rely on database audit features or triggers that store who changed what and when, which does not depend on the Metabase interface. Ask your Metabase vendor or check your plan's documentation for what Metabase itself logs about action runs, and do not assume the answer. Schedule a periodic review of changed rows against expected activity.

Keep action SQL under change control

Action SQL is code that changes production data, so store it in version control and review changes like any other code. Track which model each action attaches to, since actions run on the raw tables behind that model and a schema change can break them silently. Test changes in a non-production instance before promoting them, and keep a record of who approved each change. Confirm with your team how this workflow fits your environment.

Actions introduction

Trade-offs: actions compared with editable tables and custom admin apps

Use actions when the update is narrow, predictable and easy to describe in one parameterized SQL statement, such as marking a single ticket resolved or recording an approval flag. The risk comes from the fact that an action runs against the raw tables behind a model, and those tables are often read or written by other applications, batch jobs and reports. A change that looks harmless in a dashboard button can break an invariant the rest of the system depends on. Before approving an action, list every other writer to the target tables and confirm the action cannot leave them in an inconsistent state. For broader write paths, the comparison with editable tables is covered in the sibling topic on Metabase editable tables, so this section focuses on the decision itself.

When the update involves several steps, conditional logic, approvals, or rules that change over time, a proper admin application is usually the safer choice. An action has no natural place for multi-step validation, reusable business rules or meaningful error messages beyond what the SQL and the database constraints can express. Business rules, input validation and error handling need to live somewhere your team can version, code review and test automatically, such as a service with its own unit and integration tests. If the rule only exists inside a SQL string on a Metabase form, nobody can run a regression suite against it, and a change to a column name can silently alter behavior. Ask who will own those rules after launch and where their tests will run.

Whichever path you choose, confirm the controls before go-live: a dedicated metabase_actions database role with the narrowest write grants on the specific tables used, reviewed permissions in Metabase for who can run each action, and a test run against a non-production copy that checks both successful writes and rejected inputs. Confirm with your database team how the database enforces constraints independently of Metabase, because those constraints are the last line of defense if a form is misconfigured. The Metabase database users documentation describes the role setup in detail. If you cannot write down the rules and the tests that protect them, treat the action as a prototype and plan the admin application.

Limits to confirm in your environment

Metabase actions depend on the database engine, the plan you run, the Metabase version, the network path to public forms and how cached results behave after a write. Each limit below changes the design, so confirm it against the vendor docs and in a test environment before you commit to a build.

Database engine support

Actions are available only for PostgreSQL and MySQL. If your analytical data sits in a warehouse or another engine, write-back is not an option there, and you will need a different pattern such as a separate admin application. Confirm the engine and version you run against the current Metabase docs, then test one insert, update and delete in a non-production database.

Actions docs

Plan that matches the access model

Actions and the permissions around them must match how your groups are defined. SSO, row and column level permissions and usage auditing are included only in the Pro and Enterprise plans, so an open source or Starter instance cannot enforce the controls described here. Ask the vendor which plan includes each feature you need before you size the rollout.

Pricing page

Action features in your version

Action behavior, form options and permission settings change between releases, and the version you run decides what you can build. Check the release notes for your Metabase version and the version support window before you design forms, since non-LTS releases reach end of life sooner. Test the exact version you plan to run in production.

Version support

Public form exposure

Forms that are shared publicly are reachable by anyone with the link, so the network path matters as much as the form. Confirm which URLs are exposed, whether they sit behind a reverse proxy or a WAF, how rate limits and logging apply, and whether the form can be reached from outside your network at all. Test from an outside network segment before go-live.

Writes and cached results

Dashboards and questions can serve cached results after a write, so users may see stale values after an action runs. Check how caching is configured for the models and dashboards that feed your forms, and whether a refresh happens after each action. Confirm the behavior with a test that writes a row, then reloads the dashboard that shows it.

Database role privileges

Metabase suggests a separate role for actions with write access only to the tables that actions use or that are editable. Confirm that the role cannot write to unrelated tables, and that the grants match the statements your actions run. Review the role in your own database before you attach actions to production data.

Database roles docs

What teams ask before enabling Metabase actions

What drives the cost and effort of enabling Metabase actions?

The main drivers are the number of actions, how complex each write is, and how many systems the write must respect. Each action is parameterized SQL that writes to a table, so cost rises with the validation rules, audit requirements and approval steps you need around each one. Metabase actions are available only for PostgreSQL and MySQL, so a database outside those two needs a different approach before any effort starts. Ask any partner for a written scope that lists each action, its target tables, its validation rules and its test plan, since that list determines the quote. Licensing is a separate cost: the Metabase pricing page lists plans and the Enterprise plan is priced by quote starting at $20,000 per year, so confirm which plan your instance runs on before you plan the work.

How long does a first Metabase action take to build and test?

No duration is fixed for this work, so the honest answer depends on the write and the environment. A simple single-table update on a staging copy is a much smaller job than a form that writes to several tables and must pass a review step. Time goes into four places: agreeing on the exact fields and validation, creating the database role, building the model and action, and testing against non-production data with the failure cases included. Ask for the timeline in the written scope and check whether it includes a retest after fixes. Your own change process, including any review board or change window, often adds more elapsed time than the build itself.

What does enabling actions need from the database and security teams?

Enabling actions needs a database owner and a security reviewer to agree on who can write and to what. Metabase suggests a separate metabase_actions role with write access only to the tables used for actions or editable tables, so the database team creates that role, grants the narrowest privileges, and keeps it apart from read-only reporting access. The security team should review which groups can run each action, how forms are shared, and whether any public form is acceptable for the data involved. Both teams also need to agree on logging, since write activity should be traceable to a person or a form submission. Confirm these responsibilities in the scope so nobody assumes the other team owns them.

Can an internal team enable Metabase actions without an outside partner?

Yes, an internal team can enable actions if it has database administration skills, familiarity with Metabase models and permissions, and time for testing. The work is mostly configuration and review rather than custom code, so the main gap is usually not Metabase knowledge but the write-control design: role scoping, validation, and failure handling. Teams often bring in an outside partner for the review and testing stage, where an independent check of permissions and public form exposure is useful. Decide before starting which parts your staff own, which parts an outside party reviews, and who signs off on the production change. A clear split makes the decision easier to revisit later.

What happens if a write fails in a Metabase action?

A failed write returns an error to the person who submitted the action, and the database keeps its prior state if the statement did not commit. Because each action runs parameterized SQL against the raw tables behind a model, the failure behavior depends on the database, the statement and your transaction handling. Design for the cases you expect: a constraint violation, a missing row, a duplicate submission from a public form, and a database outage. Test each case in a non-production copy and confirm the error message does not expose table names or internal detail to people who should not see them. Ask your database team how partial writes across several statements are prevented before you put any multi-step workflow into production.

Which permissions control who can run a Metabase action?

Permissions work at two levels: the database role that Metabase uses to write, and the Metabase groups and collections that decide who can see and run each action. Scope the database role narrowly, because Metabase can only write what the role allows, and then set Metabase permissions so only the intended groups can run each action. Public forms are a separate risk, since anyone with the link can submit them, so keep public sharing off for any action that changes sensitive records. Review these settings after every change to groups or collections, because a permission granted to a broad group can quietly widen who can write.

Are Metabase actions the right choice compared with a separate admin application?

Actions suit small, well-defined updates from dashboards or forms, while a purpose-built admin application suits workflows with many rules, approvals or users. Actions run parameterized SQL on the raw tables behind a model, so every rule you need must be expressed in SQL or enforced by the database. When a write needs approvals, complex business logic, or an audit trail beyond what the database and Metabase record, a dedicated application is usually the safer choice. Compare the two options against your required controls, and ask any partner to document where each control lives.

How should a Metabase action be tested before production?

Test each action on a non-production copy of the database that uses the same role and grants as production. Cover the normal path, every validation rule, the failure cases described above, and the permission checks for each group that should and should not see the action. Record the results and rerun the tests after any change to the model, the role or the Metabase version. If your organization uses staging instances, the same role and action definitions should be promoted between them, so the production test matches what runs in practice. Ask whether the scope includes a retest after fixes so the final state is verified rather than assumed.

What a DeployOpen engagement covers for write-back

A fixed-scope engagement for actions starts with a written list of the workflows and tables that will accept writes, because that list defines every permission, form field and audit requirement that follows. For each workflow, the agreement should name the source model, the raw tables behind it, the parameters a user can enter and who may run the action. Actions are only available for PostgreSQL and MySQL, so the first check is whether your target databases are on those engines. Confirm the exact supported versions with the Metabase documentation before scoping, since the topic facts do not give a version floor.

Next, DeployOpen designs the database role that actions will use. Metabase suggests a separate metabase_actions role with write access limited to the tables used by actions or editable tables, and that role should be kept apart from the role used for ordinary querying. The design covers grants per table and column, any row restrictions the database itself can enforce, and whether the role can reach anything outside the agreed list. Your database administrators should review the grant set before it is applied, because a write role that is broader than the workflows require is the most common way this feature becomes a risk.

Building and testing then happen in your environment, against non-production data, with the test cases agreed in advance. Tests typically include a run of each action with valid and invalid parameters, a check that users outside the permitted groups cannot trigger writes, and a check that the database rejects statements outside the granted scope. For public forms, testing also covers what an anonymous visitor can and cannot see. At handover, DeployOpen documents the controls for your reviewers: the role definitions, the workflow inventory, the test results and the audit trail your database and Metabase logs produce. This is evidence that prepares your team for a compliance assessment. DeployOpen does not issue audit reports or certifications, and independent auditors and certification bodies make those determinations.

How DeployOpen scopes, delivers and supports Metabase actions

DeployOpen approaches Metabase actions as a governed write path, not a convenience feature. We scope which tables change, which database role performs each write, and which people can trigger them, then build and test the setup inside your own infrastructure before handover.

How we scope

  • Inventory every table an action or editable form would write to, and the business owner for each one.
  • Confirm the application database and target database types, since actions run only on PostgreSQL and MySQL.
  • Agree in writing which models, dashboard buttons and public forms are in scope, and which are excluded.

How we build

  • Create a dedicated metabase_actions database role with write access limited to the tables the actions use.
  • Write parameterized SQL for each action and validate inputs, types and required fields before any write runs.
  • Test permissions, public form exposure and audit trails in a non-production instance before enabling anything in production.

How we hand over

  • Document each action, its underlying tables, its database role grants, and the groups allowed to run it.
  • Provide a runbook for adding, changing or retiring actions, including who approves a change.
  • Walk your database and analytics owners through the test results and the rollback steps for each action.

How we support

  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before work starts.
  • Ongoing support, upgrades and continuous testing are available as a retainer, including retesting after Metabase upgrades.
  • Confirm with us whether your support needs cover new actions, access reviews of the metabase_actions role, or both.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.