> For the complete documentation index, see [llms.txt](https://docs.work-relay.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.work-relay.com/automations/global-actions-and-action-groups/types/create-record.md).

# Create Record

### Generic Global Action properties

This action has generic properties, as other global actions:

* **Name** - give Action a name in order to search for it easy, otherwise system will use ID of this Action.
* **Type** (Rule or Action) - this is mandatory. Select "Action".
* **ID** - given by system after saving a new Action first time.
* **Status** - you can activate or deactivate an action temporary (e.g., for debug).
* **Context Object Type** - a data source which fields can be used in Action [conditions](/automations/queries-and-conditions/working-with-conditions/conditions-overview.md) and properties.
* **Action Type** - main property which determines what Action will do and it's configuration. [Explore all action types here](/automations/global-actions-and-action-groups/types.md).
* **Execute** - specify if Action will be executed always or when some conditions are matched.&#x20;

<figure><img src="/files/Wyr0epEhpQbqgP9w7cC9" alt=""><figcaption></figcaption></figure>

### Overview

**Create Record** action allows to add a new record(s) of the selected Object.

### Configuration

* Select necessary object in Context Object Type.&#x20;

{% hint style="info" %}
This is not mandatory, but can be useful - e.g., if you want to create some new record with field values based on another record shown in current form.
{% endhint %}

* Set **Action Type** = "Create Record".&#x20;
* Select the **Object Name** - this will be an object which you will create record for.
* **Add fields**.&#x20;

{% hint style="warning" %}
All fields that are required for selected Object will be added by default and you can't remove them.
{% endhint %}

* Fill in **value** for each field. You can use static values by default. Switch to Advanced mode to use Merge Fields or [formulas](/automations/functions-and-formulas/introduction-and-usage.md) to populate values (see more info on Merge Fields and Formulas at [Working with Context objects](/automations/global-actions-and-action-groups/basics/working-with-context-objects.md) and [Working with Functions](/automations/functions-and-formulas/introduction-and-usage.md).
* Specify a **Variable Name** (optionally). This will add a variable which will be populated with the Id of the created record.&#x20;

{% hint style="info" %}
It's useful if you need to handle successful result of this action and refer to newly created record - for example, build a link to new record and send it to some user by email.
{% endhint %}

<img src="/files/nxXAo9VFAIexcU9bXnXJ" alt="" class="gitbook-drawing">

### How to create multiple records

* Check **"Repeat"** if you need to create multiple records. When checked, **two new fields** appear:
  * **Number of Iterations** - it can contain a number or some variable/merge field returning a number of records to create. If do not populate, system will show an error message.
  * **Iterator Name**: you can set a variable which will be populated with the value of the record creation cycle iterator. It's useful if you need to handle successful result of this action and refer to the index of iterations - for example, paste it in the record name. This variable should be user as standard merge field. E.g., if variable name is **record\_index**, add it as `{$Variables.record_index}`.

<figure><img src="/files/YWS3KtfsYwUOKX6cZ7Xq" alt=""><figcaption></figcaption></figure>

Iterator variable value starts from 0 and increments by 1. In the example at the picture above such records will be created:

<figure><img src="/files/JPHGHANYqpThgR4RzgSI" alt=""><figcaption></figcaption></figure>

You can use this variable in formulas. E.g., if in the example above set Account Name to `Test FORMULA[({$Variables.record_index} +1) * 10] Company`, the following records will be created:

<figure><img src="/files/Da7mTnjfyBjtuj8bMwbl" alt=""><figcaption></figcaption></figure>

### **Configure background execution**

* Check **Execute in background** if you need to execute **Create record** action in other context than current user operation. See more info at [How to use Execute in background option](/automations/global-actions-and-action-groups/using-actions/how-to-use-execute-in-background-feature.md).

  If check this option, the new field will appear:

  * **With gap**: by default it is 0, but can be set as an integer number of minutes. This field specifies interval before action execution (for repeated actions - before each iteration).

<figure><img src="/files/GVqJCT2TzF9GaJFVuUd4" alt=""><figcaption></figcaption></figure>
