# Clear File Content

This is pre-built Action located under the **@Generic Element,** instructs the Avo Assure to clear the content of the file whose path is provided in Input value and save the result in the dynamic variable.

### **Syntax**

**Input Value:**

**For Text File:** `<file location>;<file name>`&#x20;

| Argument                                 | Description                                                                                                       |
| ---------------------------------------- | ----------------------------------------------------------------------------------------------------------------- |
| <p>\<file location></p><p>(Required)</p> | <p>Provide the path of the file whose content is to be cleared.<br>Supported format:<br><strong>.txt</strong></p> |
| <p>\<file name><br>(Required)</p>        | Provide file name within which the content should be cleared.                                                     |

**For Excel File:** `<file location>,<file name>;<sheet name>(Optional)`&#x20;

| Argument                                 | Description                                                                                                                                    |
| ---------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------- |
| <p>\<file location></p><p>(Required)</p> | <p>Provide the path of the file whose content is to be cleared.<br>Supported format:<br><strong>.xls</strong>, and <strong>.xlsx</strong>,</p> |
| <p>\<file name><br>(Required)</p>        | Provide file name within which the content should be cleared.                                                                                  |
| <p>\<sheet name><br>(Optional)</p>       | Provide sheet name within which the content should be cleared.                                                                                 |

**Output value:**&#x20;

| Argument                                                    | Description                                              |
| ----------------------------------------------------------- | -------------------------------------------------------- |
| \<Dynamic Variable>(Optional);\<Dynamic Variable>(Optional) | This variable stores the status as **true** or **false** |

**Example 1**

**Clear the content of a specified text file**\
\
The **Clear File Content** action takes the value from the Input Value column (e.g.,**C:\sam;‪sample.txt** ) and clears the content of the file named (**sample.txt)** located at (**C:\sam**) The action status is saved in the **{Status}** variable with the following possible values:

* **True** –  if the file content is cleared successfully
* **False** – if the file content is not cleared

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

**Example 2**

**Clear the content of a specific Excel sheet**\
\
The **Clear File Content** action clears the content of a specified file or a sheet within a file based on the input value (e.g.,**C:\sam;Order details;sheet1**). The action status is saved in the **{Status}** variable with the following possible values:

* **True** –  if the file or sheet content is cleared successfully
* **False** –if the file or sheet content is not cleared

{% hint style="warning" %}
**Note:** If a sheet name is provided, only that sheet's content is cleared. If no sheet name is given, the entire file content is cleared
{% endhint %}

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


---

# 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.avoautomation.com/avo-assure/actions/generic/file-and-folder-operations/clear-file-content.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.
