# Add Record Stage

<figure><img src="/files/v5L9qukdwoHeYdBD8OUZ" alt="" width="563"><figcaption></figcaption></figure>

### **Add Record** <a href="#add-record" id="add-record"></a>

**Interface Overview**

1\. Select Repository

* Choose the repository where the new record should be added.

2\. Fields Mapping

Each field in the repository can be mapped using the dropdowns:

| Component    | Description                                                              |
| ------------ | ------------------------------------------------------------------------ |
| Select Field | Choose the field from the repository you want to populate                |
| Select Value | Choose how the field will be populated: Custom, Calculated, or Variable. |

**Field Behavior by Type**

A. Field Types Supporting Custom and Variable Value

* Single Line
* Multi Line
* Email
* Checkbox
* Lookup
* Multiselect
* Select
* Attachment
* User or Group
* Hyperlink
* Location

When selected:

* Custom → Shows a simple text field to manually input a value (e.g., Name>>Custom>>"Raaghav").
* Variable → Shows a dropdown of all available variables.
  * If the variable is a record or records type, an additional text field is shown to specify the record parameters.

B. Field Types Supporting Custom, Calculated, and Variable Value

* Decimal
* Number
* Date

When selected:

* Custom → Displays a text input (e.g., enter 200.5 for a decimal).
* Calculated → Displays a multi-line expression editor for formulas or expressions (e.g., {{Total}} \* 0.18).
* Variable → Displays a dropdown with all workflow variables. If variable is from a record or records type, additional field appears to input parameters.

**Example**

To add a record to a "Candidate Applications" repository:

<table><thead><tr><th width="140.99998474121094">Field</th><th width="168.39999389648438">Select Value</th><th>Result on RHS (Right-hand Side)</th></tr></thead><tbody><tr><td>Name</td><td>Custom</td><td>Display a text field Manually enter: "Raaghav"</td></tr><tr><td>Email</td><td>Variable</td><td>Displays a dropdown with all available variables</td></tr><tr><td>Experience</td><td>Calculated</td><td>Displays a multiline text area. Enter calculated expression like: {{Years}} + 1</td></tr><tr><td>Date of Joining</td><td>Custom</td><td>Displays a date picker or text field to manually enter/select the date</td></tr><tr><td>Education</td><td>Variable (Record type)</td><td>Displays a dropdown of variables and a text field to enter record-specific parameters</td></tr></tbody></table>

**Best Practices**

* Use Custom for fixed text/numeric input.
* Use Variable for dynamic inputs from earlier stages.
* Use Calculated for formulas involving variables or expressions.

### **Add Record Stage Under For Each** <a href="#add-record-stage-under-for-each" id="add-record-stage-under-for-each"></a>

This document explains how to configure and use the Add Record stage inside a For Each stage to create new records dynamically based on a list or collection from a repository.

**Overview**

The For Each stage is used to iterate over a list of items (typically a repository containing multiple records). Within it, the Add Record stage is used to insert a new record for each item that matches an optional condition.

**For Each Stage – Configuration**

1\. Select Repository

Choose the repository you want to loop over. Example: Candidate

2\. Condition

You can apply a condition to filter which items should be processed.

Example Condition: Status == "Shortlisted" This ensures only shortlisted candidates are processed in the loop.

**Add Record Stage – Inside For Each**

This stage is used to create a new record for each item in the loop.

**Configuration Steps**

1\. Select Target Repository

Choose where the new record should be added. Example: Interview Schedule

2\. Field Mapping

For each field in the target repository, define how its value will be populated:

<table><thead><tr><th width="206.79998779296875" valign="top">Field Type</th><th width="193.4000244140625" valign="top">Supported Value  Types</th><th valign="top">RHS Behavior (Right-Hand Side)</th></tr></thead><tbody><tr><td valign="top">Text, Email, Select, Checkbox, Lookup, Location, User or group, Hyperlink, Attachment, etc.</td><td valign="top">Custom, Variable, For Each Repository</td><td valign="top"><ul><li>Custom: Text field</li><li>Variable: Dropdown of variables</li><li>For Each Repository: Dropdown of fields</li></ul></td></tr><tr><td valign="top">Decimal, Number, Date</td><td valign="top">Custom, Calculated, Variable, For Each Repository</td><td valign="top"><ul><li>Custom: Text/Date input</li><li>Calculated: Multiline expression editor</li><li>Variable/For Each: Dropdown or item path</li></ul></td></tr></tbody></table>

"Select Value" Options (Dropdown Explanation)

<table><thead><tr><th width="255.0000457763672" valign="top">Option</th><th valign="top">Description</th></tr></thead><tbody><tr><td valign="top">Custom</td><td valign="top">Manually input a fixed value. Example: "Scheduled"</td></tr><tr><td valign="top">Calculated</td><td valign="top">Use expressions like {item.Score} * 0.r</td></tr><tr><td valign="top">Variable</td><td valign="top">Select from available workflow variables (outside loop context)</td></tr><tr><td valign="top">For Each Repository</td><td valign="top">Select from fields of the current item ({item}) being looped. Dropdown shows fields like Name, Email</td></tr></tbody></table>

**Example Scenario**

Goal: For every shortlisted candidate, add a record to the *Interview Schedule* repository.

For Each Stage:

* Repository: Candidate
* Condition: Status == "Shortlisted"

Add Record Configuration:

<table><thead><tr><th valign="top">Field Name</th><th valign="top">Select Value</th><th valign="top">RHS Configuration</th></tr></thead><tbody><tr><td valign="top">Candidate Name</td><td valign="top">For Each Repository</td><td valign="top">Select Name → becomes Name</td></tr><tr><td valign="top">Candidate Email</td><td valign="top">For Each Repository</td><td valign="top">Select Email → becomes Email</td></tr><tr><td valign="top">Interview Date</td><td valign="top">Custom</td><td valign="top">Manually pick a date or enter fixed value</td></tr><tr><td valign="top">Score Weight</td><td valign="top">Calculated</td><td valign="top">Enter {Score} * 0.5</td></tr><tr><td valign="top">Interviewer</td><td valign="top">Variable</td><td valign="top">Select {AssignedInterviewer}</td></tr></tbody></table>

### **Add Record Stage Under Condition Stage** <a href="#add-record-stage-under-condition-stage" id="add-record-stage-under-condition-stage"></a>

The Add Record stage can be placed inside a Condition stage to create a new record only when specific criteria are met.

**Condition Stage – Overview**

Purpose:

The Condition stage evaluates a boolean expression using workflow variables. If the condition returns true, the nested stages (like Add Record) are executed. If false, they are skipped.

**Configuration:**

Add a Condition Stage:

* Drag and drop the Condition Stage into your workflow.
* Choose “Condition” (not Condition Set).
* Set logic (e.g., AND).
* Select variable: Total Score
* Condition: Greater Than or Equal To
* Value: 5

**Add Record Stage – Inside Condition:**

This stage is used to insert a new record only when the condition evaluates to true.

1\. Select Repository:

Choose the repository where the new record should be added.

Example: Offer Letters

2\. Field Mapping:

<table><thead><tr><th valign="top">Field Type</th><th valign="top">Supported Value Types</th><th valign="top">RHS Behavior (Right-Hand Side)</th></tr></thead><tbody><tr><td valign="top">Text, Email, Select, Checkbox, Lookup, Location, User or group, Hyperlink, Attachment, etc.</td><td valign="top">Custom, Variable</td><td valign="top"><ul><li>Custom: Text field</li><li>Variable: Dropdown of available variables</li></ul></td></tr><tr><td valign="top">Decimal, Number, Date</td><td valign="top">Custom, Calculated, Variable</td><td valign="top"><ul><li>Custom: Text/Date input</li><li>Calculated: Multiline expression editor</li><li>Variable: Variable dropdown</li></ul></td></tr></tbody></table>

**Example Scenario**

Goal: If a candidate is selected, create a new Offer Letter record.

Condition Configuration:

* Select variable: Total Score
* Condition: Greater Than or Equal To
* Value: 5

Add Record Configuration (inside true path)

| Field          | Select Value | RHS Result                   |
| -------------- | ------------ | ---------------------------- |
| Candidate      | Variable     | ${Variable:Candidate\_Name}  |
| Email          | Variable     | ${Variable:Candidate\_Email} |
| Offer Status   | Custom       | "Draft"                      |
| Salary Offered | Calculated   | {Candidate:ExpectedCTC}\*1.1 |


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.aiflo.app/web-workflow/add-record-stage.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
