# Write to Cell in File

This is a pre-built Action located under the **@Excel Element**. The functionality of this Action in Avo Assure is to write the content specified in the **Input Value** column into the referenced cell of the Excel sheet. The result of this operation is stored in a dynamic variable for further use during test execution.

## **Syntax**                                         &#x20;

**Input Value**: `<Row>;<Column>;<Value>;<Type>`&#x20;

| Argument                       | Description                                                                                                 |
| ------------------------------ | ----------------------------------------------------------------------------------------------------------- |
| <p>\<Row><br>(Required)</p>    | Provide the row number of the Excel file where you want to write the data.                                  |
| <p>\<Column><br>(Required)</p> | Provide the column number of the Excel file where you want to write the data.                               |
| <p>\<Value><br>(Required)</p>  | Provide the actual data you want to write into the specified cell.                                          |
| <p>\<Type><br>(Required)</p>   | Provide the format of the value you want to write, such as **String**, **Number** and **Dynamic Variable**. |

**Output Value**: `<Dynamic Variable>(Optional);<Dynamic Variable>(Optional)`&#x20;

| Argument                                                    | Description                                                       |
| ----------------------------------------------------------- | ----------------------------------------------------------------- |
| \<Dynamic Variable>(Optional);\<Dynamic Variable>(Optional) | Both dynamic variable stores the status as **True** or **False**. |

### Example 1: Writing String Data to a Specific Cell

In this example, we explain how to write string data into a specific cell of an Excel file using the **Write to Cell in File** action.

* **Action**: Write to Cell in File
* **Input Value**: 2;3;IT;string
  * The row number (**2**) specifies the row position in the Excel sheet where the data needs to be written.
  * The column number (**3**) specifies the column position within the same sheet. Combined with the row number, these coordinates identify the exact cell (Row 2, Column 3) in the Excel file where the value IT will be written.
  * The data value  (**IT**) represents the content that will be written into the specified cell.
  * The data type (**string**) indicates that the value written is text based.
* **Output Value**: {Status}
  * The execution status of the action is stored in this **{Status}** variable with the following possible values:
    * **True:** If the data is written successfully.
    * **False**: If the data is not written successfully.
* **Logical Explanation**: The **Write to Cell in File** action takes the value from the **Input value** column **2;3;IT;string** and writes the string **IT** into the specified cell (Row 2, Column 3) in the configured Excel file. The execution status of this operation is stored in the **{Status}** variable as true.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FSNZ8WCK0koa7q886tUZd%2Fimage.png?alt=media&#x26;token=e3618f57-a056-4eca-9682-d70dd17fa9cb" alt=""><figcaption></figcaption></figure>

### Example 2: Writing Numeric Data to a Specific Cell

In this example, we explain how to write numeric data into a specific cell of an Excel file using the **Write to Cell in File** action.

* **Action**: Write to Cell in File
* **Input Value**: 6;4;6000;Number
  * The row number (**6**) specifies the row position in the Excel sheet where the data needs to be written.
  * The column number (**4**) specifies the column position within the same sheet. Combined with the row number, these coordinates identify the exact cell (Row 6, Column 4) in the Excel file where the value **6000** will be written.
  * The data value (**6000**) represents the numeric content that will be written into the specified cell.
  * The data type (**Number**) indicates that the value being written is numerical.
* **Output Value**: {Status}
  * The execution status of the action is stored in this **{Status}** variable with the following possible values:
    * **True**: If the data is written successfully.
    * **False**: If the data is not written successfully.
* **Logical Explanation**: The **Write to Cell in File** action takes the **Input value** column **6;4;6000;Number** and writes the numeric value **6000** into the specified cell (Row 6, Column 4) in the configured Excel file. The execution status of this operation is stored in the **{Status}** variable as true.

<figure><img src="https://2174257472-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fk8QZzXZMIJSStKAzDSTu%2Fuploads%2FO91cdZZFYtJfmxdCYCCw%2Fimage.png?alt=media&#x26;token=44c45f06-0d34-4ad1-bf60-9caaba1abc3e" alt=""><figcaption></figcaption></figure>
