Pro Documentation

What is a View?

A View is a saved MongoDB aggregation pipeline that runs against a collection and returns shaped results. Views are created under Data → Views and exposed via a REST endpoint that respects role-level and row-level access.

Views require a MongoDB connection configured in config/connections.json.

Allowed Pipeline Stages

StagePurpose
$matchFilter documents by field values
$sortOrder results
$projectInclude, exclude, or rename fields
$lookupJoin from another collection
$unwindFlatten an array field
$addFieldsCompute new fields
$groupAggregate (count, sum, etc.)
$limitCap results
$skipSkip N results
$countReturn a document count

Blocked: $out, $merge, $function, $accumulator, $graphLookup

Collections are prefixed cms_ in MongoDB — use this prefix in $lookup from values.

Example Pipeline

Match active entries and count related submissions:

[
  { "$match": { "data.isActive": true } },
  {
    "$lookup": {
      "from": "cms_feedback",
      "localField": "_id",
      "foreignField": "data.userId",
      "as": "submissions"
    }
  },
  { "$addFields": { "submissionCount": { "$size": "$submissions" } } },
  { "$project": { "data.name": 1, "data.email": 1, "submissionCount": 1 } },
  { "$sort": { "submissionCount": -1 } }
]

Access Control

SettingDescription
Allowed RolesWhich roles can call GET /api/views/:slug/public
PublicNo authentication required when checked
Row-Level — OwnerUser sees only entries they created
Row-Level — Field MatchA specified entry field must match a user property

What is an Action?

An Action is a named sequence of steps that runs against a single collection entry. Actions are defined under Data → Actions and can be triggered from the entry list or via the [cta] shortcode on any public page.

Actions require a MongoDB connection configured in config/connections.json.

Steps run in order. If a step fails, execution stops and a partial result is returned with a stepsCompleted count.

Step Types

TypeWhat it does
updateFieldSets a field on the entry to a new value
deleteEntryPermanently deletes the target entry
moveToCollectionMoves the entry to a different collection
webhookPOSTs entry data to an external URL
emailSends an email via the configured SMTP server

Template Variables

All step field values support {{...}} interpolation:

VariableValue
{{entry.data.fieldName}}Any field from the target entry
{{entry.id}}The entry's UUID
{{now}}Current ISO 8601 timestamp
{{user.name}}Name of the triggering user
{{user.email}}Email of the triggering user
{{user.id}}UUID of the triggering user
{{env.CMS_PUBLIC_*}}Public environment variables

Step Examples

updateField — mark an entry as approved:

{ "field": "status", "value": "approved" }

webhook — notify an external service:

{
  "url": "https://hooks.example.com/notify",
  "headers": { "X-Secret": "{{env.CMS_PUBLIC_HOOK_SECRET}}" }
}

email — send confirmation to applicant:

{
  "to": "{{entry.data.email}}",
  "subject": "Your application was approved",
  "body": "Hi {{entry.data.name}}, your application has been approved."
}

What is the CTA shortcode?

The [cta] shortcode places an action-trigger button in any public page. Clicking it calls POST /api/actions/:slug/public with the entry ID, using the logged-in user's JWT.

If the user is not logged in, a warning toast is shown instead.

Syntax & Attributes

Wrapping form:

[cta action="slug" entry="entry-id" icon="check" confirm="Are you sure?"]Button label[/cta]

Self-closing form:

[cta action="slug" entry="entry-id" label="Button label" /]
AttributeRequiredDefaultDescription
actionYesAction slug
entryYesEntry UUID to act on
labelNo"Run"Button text (self-closing only)
styleNo"primary"primary · secondary · ghost · danger
iconNoDomma icon name
sizeNosm · md · lg
confirmNoConfirmation prompt before executing

Collection Integration

Add per-entry buttons to any [collection] shortcode:

[collection slug="applications" display="cards" title-field="name"
  cta="approve-application"
  cta-label="Approve"
  cta-icon="check"
  cta-style="primary"
  cta-confirm="Approve this application?" /]
AttributeDefaultDescription
ctaAction slug — enables per-entry buttons
cta-label"Run"Button label
cta-iconDomma icon name
cta-style"primary"Button variant
cta-confirmConfirmation prompt

All three display modes support CTA buttons: cards (card footer), list (inline), table (dedicated column).

Full Reference

See the public documentation for live examples and the complete attribute reference:

CTA Shortcode Reference