# Add/Delete

The **Add/Delete Task** in Fusion allows Designers to insert or remove rows from a grid in a more dynamic and configurable way than standard Excel options. With enhanced filters and custom logic, this feature offers more flexibility and control within your app.

## Getting Started

1. Open Excel and launch **Fusion** via the **Fusion Ribbon**.
2. Select your app from the **Connections** list.
3. Go to the **Tasks** menu, click **New Task**, then select **Add/Delete**. or\
   Go to the **Tasks** menu, select **Add/Delete**, then click **New Add/Delete Task**.

<figure><img src="/files/YHZXsqcwa6g8cPdxL0Bo" alt=""><figcaption><p>New Task - Add/Delete</p></figcaption></figure>

***

## Add Task

To create an Add Task:

1. In the Add/Delete Task window, set the **Type** to **ADD**.
2. Enter the task **Name**.
3. Choose the **Map** and the corresponding **Object Name** from the dropdown.

<figure><img src="/files/bE1lx4t6thKTZ6bHKJv2" alt=""><figcaption><p>Set the name and map of the Add Task</p></figcaption></figure>

### Add Task Properties

You can define how rows will be added using one of the four available **Add Task Properties**:

#### STATIC

Use the **STATIC** option to add a fixed number of rows to the bottom of the grid.

**Steps:**

1. Select **STATIC** as the property type.
2. Enter the number of rows you want to add in the **Static Record Count** field.

> 💡 Use this option when the number of rows to be added is always the same and doesn't need to change at runtime.

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

#### CELL REFERENCE

Use this option to dynamically add rows based on a cell value—without needing to reopen the Design Studio.

**Steps:**

1. Enter the **cell reference** of the topmost cell of the map in the **Cell** field.
   * **Format:** `<MapName>!<CellAddress>`
   * **Example:** `Schedule Item!$A$1`
2. During runtime, update the value in that cell with the number of rows you want to add.\
   Fusion will insert that number of rows at the bottom of the grid.
3. **Quick setup tip:**\
   Before entering the cell reference, click the desired cell in your worksheet. Then, click the selector button next to the **Cell** field to automatically populate it with your selected cell.

> 💡 **Tip:** This method gives Designers the flexibility to control row count at runtime—no need to reconfigure the Add task in Design Studio.

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

#### NAMED RANGE REFERENCE

Use a **named cell** to dynamically control the number of rows added at runtime.

**Steps:**

1. In Excel, right-click the desired cell and select **Define Name**.
2. Assign a name to the cell (e.g., `RecordCount`) and click **OK**.
3. In the **Add Task** configuration, search for and select the **Named Range** from the dropdown list.
4. During runtime, update the value of that named cell to insert that number of rows at the bottom of the grid.

> 💡 **Cell Reference vs Named Range Reference**\
> When your Excel layout changes—such as when rows are added or removed—**Cell References** may break and need to be manually updated.\
> In contrast, **Named Ranges** automatically adjust and remain consistent.

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

#### RECORD COUNT

Use the **Record Count** option to add rows based on the number of records returned by another map.

**Steps:**

1. Select **Record Count** as the property type.
2. Choose the **target map** that you want to reference.
3. Configure the input in the **Workflow**.

Fusion will automatically insert the same number of rows as the records found in the selected map.

**Example:**\
If the map **CustomerAccount** returns 5 records, Fusion will add **5 rows** to the grid during runtime.

> 💡 This is useful when you want to ensure row count dynamically matches another dataset.

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

### In Flight Message Properties

Customize the message users see while the Add Task is running.

**Message Style Options:**

* **Default**\
  Displays the standard message:\
  \&#xNAN;*“Inserting rows to the grid”*
* **Custom**\
  Enter your own message (up to 50 characters).\
  Example: *“Adding {0} new entries for this trial”*

  > {0} will be replaced with the number of records being added.
* **No Message**\
  If selected, Fusion will show a fallback message such as:\
  \&#xNAN;*“Executing Workflow”*

**Include Record Count**

Tick this checkbox to display the total number of records in the message.

> Works with both **Default** and **Custom** styles.

<div align="left"><figure><img src="/files/JiKJyNrH45ezxKY22uPu" alt=""><figcaption></figcaption></figure></div>

### Final Step – Save the Add Task

After configuring all required fields and properties (including Messaging, Map, and Add Task type), make sure to **click Save** to apply the changes.

> ⚠️ **Note:** The Add Task will not run in the app unless it has been saved.

<figure><img src="/files/3SZyJVDOH3dnEaejqbqw" alt=""><figcaption></figcaption></figure>

***

## Delete Task

To create a Delete Task:

1. In the Add/Delete Task window, set the **Type** to **DELETE**.
2. Enter the task **Name**.
3. Choose the **Map** and the corresponding **Object Name** from the dropdown.

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

### Delete Task Properties

Configure how records should be deleted during runtime using the options below:

#### Apply Delete Operation to Selected Record(s) Only

Enable this to delete records **based on the user's selection** in the grid during runtime.

> Use this when you want users to have control over which rows are deleted.

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

#### Disable Fast Delete

Enable this option to **turn off the fast delete feature**.

> This is helpful in scenarios where slower, more controlled deletion is required (e.g., when dependencies or validations are involved).

<figure><img src="/files/4GzMeV3RaHYYZKY1bkxQ" alt=""><figcaption></figcaption></figure>

#### Add Condition Filters *(Optional)*

Use filters to delete only the records that meet specific conditions.

**Steps:**

1. Click **Add Condition Filter**.
2. Configure each condition by setting the following:
   * **Map Field**
   * **Type**
   * **Operator**
   * **Value**
3. (Optional) Click the **remove** icon to delete a condition.
4. Enable **Condition Filters Logic** if you want to define logical relationships between filters (e.g., AND/OR).

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

#### Delete Confirmation

Prompt users before deleting records to prevent accidental deletions.

**Steps:**

1. Enable **Ask for confirmation before deleting records**.
2. Enter a custom confirmation message (optional).\
   Example: *"Are you sure you want to delete the selected records?"*

> 💡 Use this feature to add a layer of safety and clarity for end users.

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

### Delete Task – Messaging Options

Fusion allows you to customize the messages displayed **during** and **after** the Delete Task is executed. This helps provide clarity to users and improves the runtime experience.

#### In-Flight Message

This message appears while the delete operation is running.

**Message Style Options:**

* **Default**\
  \&#xNAN;*“Deleting rows from the grid”*
* **Custom**\
  Write your own message (up to 50 characters).\
  Example: *“Deleting {0} patient entries”*

  > `{0}` will be replaced with the actual number of records being deleted.
* **No Message**\
  Fusion will display a fallback message such as: *“Deleting 'number of records' records”*

<div align="left"><figure><img src="/files/3z3q4mVJIJfSuXvrP1wq" alt=""><figcaption></figcaption></figure></div>

#### Skipped Summary Configurator

This message appears after the delete operation completes and summarizes any records that couldn’t be deleted.

**Message Style Options:**

* **Default**\
  \&#xNAN;*“records were skipped”*
* **Custom**\
  Example: *“Deleting {0} patient records were skipped”*
* **No Message**\
  Fusion will use a default fallback message.

<div align="left"><figure><img src="/files/fEpWZGpC40wgkwGZ6S8S" alt=""><figcaption></figcaption></figure></div>

#### Include Record Count

Enable the **Include record count** checkbox to show the total number of records in your message.

> 💡 Works for both **In-flight** and **Skip Summary** messages when using Default or Custom styles.

***

### Final Step – Save the Delete Task

After configuring all properties, don’t forget to **click Save** to activate the Delete Task.

> ⚠️ **Note:** The task must be saved for it to be available during runtime.

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

***

## What’s Next?

After creating and saving your Add or Delete Task, **Designers must configure the task in the Workflow** to make it executable at runtime.

👉 Go to Workflow Configuration *(*[*Add/Delete Task Workflow*](/valorx-fusion/design-studio/workflow-and-ux/add-delete.md)*)*

> 💡 Tasks that are not added to a workflow will not run in the app.


---

# 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.valorx.com/valorx-fusion/design-studio/tasks/add-delete.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.
