# Update Record Stage

The **Update Record** stage allows you to update an existing record in a selected repository by mapping fields with new values using **Custom**, **Calculated**, **Variable**, or **For Each Repository** inputs, depending on context and field type.

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

### **Update Record Stage** <a href="#update-record-stage" id="update-record-stage"></a>

**Interface Overview**

1\. Select Repository

* Choose the repository that contains the record you want to update.

**2. Identify Record (Filter)**

* Select the method to identify which record(s) to update.
* Usually done by matching a unique field (e.g., ID, Email, etc.) using a variable or item reference.

2\. Fields Mapping

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

| Component    | Description                                                            |
| ------------ | ---------------------------------------------------------------------- |
| Select Field | Choose the field in the repository you want to update                  |
| Select Value | Choose how the field will be updated: custom, Calculated, or Variable. |

**Field Behaviour by Type**

A. Field Types Supporting Custom, For Each & 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
* An additional text field is shown to specify the variable as “${Variable:VariableName}”
* If the variable is of type record or records, use the format ${Variable:VariableName:FieldName} to access a specific field.
* For Each Repository → Select from current iteration item fields

B. Field Types Supporting Custom, Calculated, For Each 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
* An additional text field is shown to specify the variable as “${Variable:VariableName}”
* If the variable is of type record or records, use the format ${Variable:VariableName:FieldName} to access a specific field.
* For Each Repository→ Select fields from current item

**Example**

Goal: Update candidate record with interview result

<table><thead><tr><th valign="top">Field</th><th valign="top">Select Value</th><th valign="top">Result on RHS (Right-hand Side)</th></tr></thead><tbody><tr><td valign="top">Status</td><td valign="top">Custom</td><td valign="top">Displays a DD field. Select: "Completed"</td></tr><tr><td valign="top">Interview Score</td><td valign="top">Variable</td><td valign="top">Displays a Dropdown with all available variables.</td></tr><tr><td valign="top">Interview Date</td><td valign="top">Custom</td><td valign="top">Select Date</td></tr><tr><td valign="top">Date of Joining</td><td valign="top">Calculated</td><td valign="top">{TargetRepository:InterviewDate}&#x3C;PLUS>30</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.

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

Used to update records dynamically inside a loop based on conditions.

For Each Stage – Configuration

1. Select Repository: Repository to iterate (e.g., Candidate Interviews)
2. Condition (Optional): Apply filters, e.g., Status == "Completed”

Update Record Configuration (Inside For Each)

| Step              | Description                                                         |
| ----------------- | ------------------------------------------------------------------- |
| Select Repository | Choose the repository to update (e.g., Candidate)                   |
| Identify Record   | Match Record via unique field (e.g., Email or ID from current item) |
| Field Mapping     | Define field updates using Custom, Variable, Calculated, For Each   |

Example:

You want to update existing records in the Candidate repository for each item in the Candidate Interviews repository — but only for interviews that have been completed.

Let’s say your system tracks candidates and their interviews in two separate repositories:

* **Candidate Interviews** (used to store details of individual interview rounds)
* **Candidate** (master record for each candidate)

After interviews are conducted, you want to loop through the **Candidate Interviews** repository and:

* Identify completed interviews.
* Update the corresponding candidate’s record with the latest interview score, comment, and status.

| Field Name       | Select Value        | RHS Configuration         |
| ---------------- | ------------------- | ------------------------- |
| Interview Status | Custom              | “Completed”               |
| Interview Score  | For Each Repository | Score                     |
| Candidate        | Variable            | ${Variable:CandidateName} |
| Updated On       | Calculated          | \<TODAY>\<PLUS>0          |

### &#x20;**Update Record Stage Under Condition** <a href="#update-record-stage-under-condition" id="update-record-stage-under-condition"></a>

Use this to update a record only if specific criteria are met.

**Condition Stage – Overview**

* Evaluates a boolean condition using workflow variables.
* If true, runs the nested Update Record stage.
* If false, skips the update.

**Update Record Stage – Inside Condition:**

This stage is used to update existing record only when the condition evaluates to true.

1\. Select Repository:

Choose the repository where the existing record should be updated.

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 candidate score ≥ 7, update status to “Selected” and set joining date.

**Condition Configuration**

* Variable: Total Score
* Condition: Greater Than or Equal To
* Value: 7

Update Record Configuration (inside true path)

| Field          | Select Value | RHS Result                   |
| -------------- | ------------ | ---------------------------- |
| Candidate Name | Variable     | ${Variable:Candidate\_Name}  |
| Email          | Variable     | ${Variable:Candidate\_Email} |
| Offer Status   | Custom       | "Selected"                   |
| Joining Date   | Calculated   | \<TODAY>\<PLUS>30            |


---

# 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/update-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.
