Skip to main content
Automation API

record_create

Use this action to create a record in a database app from an automation.

Tip

Read the live config shape of each action type from GET /v1/automation/meta/action before you build on it.

In the automation editor, this action is Create a record in the Current record family. Its group is action, and it works with every trigger.

Send it in the actions array of Create an automation or Update an automation. An update replaces the whole array, so include the other actions.

Example​

When a deal is won in a CRM, this action creates a kick-off task in the Tasks database app:

{
"type": "record_create",
"config": {
"app_id": 4021,
"field_assignments": [
{
"field_type": "single_text",
"variable_def": { "kind": "variable", "source": "field", "field_id": 51207, "field_type": "single_text", "previous": false, "collection": false, "triggering": false },
"assignment_type": "set",
"field_value": ["Kick-off call for deal ", { "kind": "variable", "source": "meta", "meta_type": "app_record_id", "app_id": 87 }]
},
{
"field_type": "single_category",
"variable_def": { "kind": "variable", "source": "field", "field_id": 51208, "field_type": "single_category", "previous": false, "collection": false, "triggering": false },
"assignment_type": "set",
"field_category_option_id": 3
}
],
"author_id": { "kind": "variable", "source": "meta", "meta_type": "created_by", "app_id": 87 },
"trigger_other_flows": false
}
}

Config​

PropertyTypeDescriptionExample value
app_idintegerID of the database app Tape creates the record in.4021
field_assignmentsarray of field assignmentsValues Tape writes into the new record, one entry per field. Left out or [], Tape creates an empty record.[]
author_idinteger | referenceUser Tape attributes the new record to: a user ID, or a reference to the creator, the last modifier or a user field. Left out, the automation itself is the author.812
trigger_webhooksbooleanWhether the new record fires outbound webhooks. Default false.false
trigger_other_flowsbooleanWhether the new record starts other automations. Default false.false
silentbooleanWhether Tape sends no notifications for the new record. Default false.true

To find app_id and the field IDs, see App and field IDs. To find the option ID for field_category_option_id, see Retrieve a single app. It returns the options in config.settings.options of the field.

author_id, trigger_webhooks, trigger_other_flows and silent are shared by every action that changes records. In the action menu of the automation editor, they are Author, Trigger webhooks, Trigger automations and Silent. To find a user ID for author_id, see Retrieve organization users.

Field assignments​

Each entry of field_assignments sets one field of the new record. There are 20 assignment shapes, one per field type. They share these members:

  • field_type (required): the type of the target field, for example single_text or single_category. It selects the shape of the entry.
  • variable_def (required): a field reference to the target field, with source: "field", field_id and field_type.
  • assignment_type: how Tape produces the value. The modes depend on the field type. A single_text entry takes set, unset or set_code.
  • A value member that fits the mode: field_value for set on a text field, field_category_option_id for set on a category field, code for set_code. unset carries no value.
  • id: stable ID of the entry. Tape creates one when you leave it out and returns it on read.

meta/action describes the populated shape only loosely. Copy the shapes from the example above and check the live config_schema before you send filled assignments.

Use the new record in a later action​

A later action reads the new record with a created_record reference. With "property": "id", it returns the record ID:

{ "kind": "variable", "source": "action", "action_type": "created_record", "app_id": 4021, "property": "id" }

General behavior​

  • No key is required by the schema. Send app_id anyway. Without it, the action saves but creates no record.
  • An app_id of a deleted app gives the broken reason action_app_missing. An app_id that never existed makes validate and activate return 404.
  • Tape refuses an entry with 400 when its mode needs a value that the entry doesn't send. For example, set without field_value on a text field.
  • Without author_id, the automation itself is the author. A user ID that Tape can't find gives the broken reason action_user_missing.
  • Tape returns silent on every read. It's false when you left it out.
  • Keep trigger_other_flows at false to avoid a loop when the automation triggers on the same database app.

Requirements​

  • To add or change this action through the API, your token needs the automations:edit capability. See Capabilities.
  • You must administer the workspace that the automation's database app belongs to.
  • The target database app must exist in your organization.

Next steps​