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
Text and numeric inputs:string— Plain text inputnumber— Numeric inputemail— Email address inputurl— URL input
date— Date pickertime— Time pickertimestamp— Combined date and time picker
select— Single-select dropdownmulti_select— Multi-select dropdowncheckbox— Checkbox groupradio— Radio button group
Field IDs
Each field has anid 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>.
Selection Field Options
Theselect, multi_select, checkbox, and radio field types all require an options configuration. All four types support static options. Only select and multi_select also support a dynamic options source. A field must have one or the other, not both.
Static Options
Provide a fixed list of options directly in the field configuration. Each option has alabel (displayed to the user) and a value (submitted with the form).
Dynamic Options
Dynamic sources allow you to populateselect and multi_select inputs by calling a List endpoint on Formal’s API. This is useful when the set of options changes over time (e.g., listing resources, users, or datastores). checkbox and radio fields do not support dynamic sources and must use static options.
A dynamic source has the following configuration:
| Parameter | Description |
|---|---|
| App | The service name (e.g., core.v1.ResourceService) |
| Command Name | The method name without the List prefix (e.g., Resources for the ListResources method) |
| Machine User ID | The machine user used to authenticate options retrieval |
| Input | The JSON request body. Use ${{ query }} to interpolate the user’s search text into the request. You can also pass searchFields to control which fields are searched |
| Transform | A CEL expression evaluated against the response body (available via the body variable) when the response is a 200. Should return a list of objects with value and text fields |
searchFields parameter in the input controls which fields the search term is matched against. For example, "searchFields": ["name", "technology", "hostname"] restricts matching to those three fields on the target resource.
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
- User opens the form shortcut in Slack
- User selects a form from the searchable dropdown
- User fills out the fields and submits
- A confirmation message with the submitted values is sent to the user
- Any workflows with a matching
form-submissiontrigger are executed
Using Forms in Workflows
Forms connect to workflows via theform-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
Referencing Form Data in CEL
Form submission data is available undertrigger.form_submission:
| Expression | Description |
|---|---|
trigger.form_submission.form_id | The ID of the submitted form |
trigger.form_submission.form_name | The name of the submitted form |
trigger.form_submission.submitter_email | Email of the user in Slack who submitted the form |
trigger.form_submission.submission.field_<id> | Value of a specific field by its ID |
Terraform Example
Next Steps
Workflows
Learn about workflow triggers, actions, and chaining
Slack Integration
Configure your Slack integration for forms