# File

## Introduction

The **File** storage action in **DBSync Cloud Workflow** enables you to read, write, move, and rename files from your **local machine or desktop environment**. This action is especially useful for handling structured data formats such as **CSV**, **JSON**, and **XML**, supporting a wide range of data processing and integration workflows.

You can use this feature to:

* Archive files for audit or backup purposes
* Transfer data to a target location for downstream processing
* Rename or organize files as part of automated workflows

Whether you're automating data extraction, preparing reports, or managing file-based integrations, the File Storage action offers the flexibility and control needed to manage files effectively within your integration pipeline.

<figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FPA1pBHezMO5EQWQ61K63%2Ffile.png?alt=media&#x26;token=71e6cd6c-a038-437c-9621-957f78a9deea" alt=""><figcaption></figcaption></figure>

### **Use Cases**

* Archiving transaction data
* Exporting data for manual review

## **Configuration Steps**

{% hint style="info" %}
NOTE: It is necessary to configure the Remote Agent before using the File Storage action.
{% endhint %}

1. **Add File Storage Action to Workflow**

* Drag and drop the File storage action into your workflow.
* Click Configure provided on the File action.
* Click on the Select Agent dropdown and select the agent that you have configured.
* Select the desired operations provided (**READ, WRITE, MOVE/RENAME**).

<figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2Faq6qxuzom1z9WguNmlrA%2Ffile1.png?alt=media&#x26;token=7d78a3eb-28bf-4158-a36a-d008199415ec" alt=""><figcaption><p>Read from a FIle</p></figcaption></figure>

2. **Define Storage Parameters for READ operation**

* **File Path:** Specify the Dropbox folder path where the file should be fetched from (for example, C:/backup/invoices).
* **File Content:** All downloaded files will be stored in a variable. This name is auto generated, however user can also change if needed.\
  This variable will be added to the datastream (Central fx) to process further.&#x20;
* **Preview:** It displays the list of files that you have selected.
* **Properties**
  * **Include files in the sub folder? YES/NO:** Provides the option to read only the parent folder or including subfolders.

<figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FvAyi1y2FNDFTzpf33A84%2Ffile2.png?alt=media&#x26;token=c9b60cfe-6a87-47bb-bb29-d788e4ae32c5" alt=""><figcaption><p>Write to a File</p></figcaption></figure>

3. **Define Storage Parameters for WRITE operation**

* **File Path:** Specify the Dropbox folder path where the file should be copied (for example, C:/backup/invoices).
* **File Name:** Define the name for the file to be saved. You can use dynamic variables like ***File Name, Local File Path, Download File Path, File Size, Remote File Last Modified Date Time***.
* **File Content:** All downloaded files will be stored in a variable. This name is auto generated, however user can also change if needed.\
  This variable will be added to the datastream (Central fx) to process further.
* **Properties**
  * **Overwrite:** Enable if you want to overwrite files with the same name.
  * **Skip:** Enables you to skip overwriting the file with the same name.
  * **Batch size:** user can select the batch size of 1, 50, 100, 200, 500 from the dropdown.
  * **Create Sub folder:** Enable the checkbox to add a static name or drop any variable from the data stream to name dynamically. Or it can be a combination of both.

<figure><img src="https://1036205596-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fv9avy716UiAsS24zOznZ%2Fuploads%2FoPADg0vNtuMzbEWfYJlV%2Fimage%20(18).png?alt=media&#x26;token=cfbf75e4-0b06-4a3b-bbcf-6113db1d43d1" alt=""><figcaption><p>MOVE/RENAME operation</p></figcaption></figure>

4. **Define Storage Parameters for MOVE/RENAME operation**

This operation is provided for you to move the data from one file path to another. You can also rename it while moving.

* **Source File Path:** Choose a file from the drop down list OR input a regular expression for a customized and dynamic pattern.
* **Destination File Path:** Choose a file from the drop down list OR input a regular expression for a customized and dynamic pattern.

### **Best Practices**

* Use consistent naming conventions to keep files organized.
* Leverage timestamp placeholders for versioning.
* Secure credentials when using external storage locations.
* Validate output by enabling logging or audit trails.

### **Limitations**

* File size limits may apply depending on the chosen storage.
* Format conversion should be handled explicitly in data preparation steps.
