Skip to main content

Overview

Forms enable structured data collection that can trigger workflows. A form defines a set of typed fields that users fill out via Slack. When submitted, the form data is available to workflow actions via CEL expressions. Forms are useful for Access requests: Enable users to request access to perform specific action on resources with time-bound parameters for policy suspensions.

Form Structure

A form consists of:
  • Name: A unique name within your organization
  • Description: Optional description shown to users when filling out the form
  • Fields: One or more typed fields for data collection

Field Types

  • string
  • number
  • timestamp

Field IDs

Each field has an id that must match the pattern field_[_a-zA-Z0-9]+. This ID is used to reference field values in workflow actions via trigger.form_submission.submission.field_<id>.

Slack Integration

Forms are filled out via Slack using the “Fill out form” shortcut. A Slack integration needs to be linked to your Formal organization.

Slash Command

Type /formal form to open a modal where you can select and fill out a form.

Submission Flow

  1. User opens the form shortcut in Slack
  2. User selects a form from the searchable dropdown
  3. User fills out the fields and submits
  4. A confirmation message with the submitted values is sent to the user
  5. Any workflows with a matching form-submission trigger are executed

Using Forms in Workflows

Forms connect to workflows via the form-submission trigger type. See the workflows documentation for trigger details. Form data will not be saved in the Formal Control Plane unless there is at least one workflow with the corresponding form-submission trigger type.

Example: Access Request with Approval

trigger:
  type: form-submission
  name: access_request
  args:
    id: form_abc123

actions:
  - type: ask-in-chat
    name: ask_approval
    args:
      message: "${{ trigger.form_submission.submitter_email }} is requesting access to ${{ trigger.form_submission.submission.field_resource }}. Reason: ${{ trigger.form_submission.submission.field_reason }}. Approve?"
      recipient_channel: "security-approvals"
      integration: slack

Referencing Form Data in CEL

Form submission data is available under trigger.form_submission:
ExpressionDescription
trigger.form_submission.form_idThe ID of the submitted form
trigger.form_submission.form_nameThe name of the submitted form
trigger.form_submission.submitter_emailEmail of the user in Slack who submitted the form
trigger.form_submission.submission.field_<id>Value of a specific field by its ID

Next Steps