# Excel Writer

This component is used to write data to an Excel file. It can be used to create new Excel files or append data to existing files.

![](https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image278.png)

## **Input**

&#x20;

<table><thead><tr><th width="211">Attribute</th><th>Description</th></tr></thead><tbody><tr><td>Input Param</td><td>Input parameter of the excel data</td></tr><tr><td>Sheet Name</td><td>Sheet name to write</td></tr><tr><td>Extension</td><td>Excel format .xls/.xlsx</td></tr><tr><td>Header Exists</td><td><p>Does header row exist?</p><p>If yes, the column names will be written in the first row.</p><p>The first row means the starting row.</p></td></tr><tr><td>Starting Row</td><td><p>Row number starts from 0.</p><p>If starting row is 0 and header exists, the data row will be written from the second row(1).</p></td></tr><tr><td>Output Path</td><td>The path of the output excel file</td></tr><tr><td>Output File</td><td>The name of the excel file</td></tr><tr><td>Mode</td><td><p>Write mode.</p><p>·       Overwrite</p><p>·       Append</p><p>In the case where the input data has more than 50K records, the overwrite mode is always applied, and the previous contents of the target file are completely replaced with the new data. </p></td></tr></tbody></table>

&#x20;

## **Output**

&#x20;

<table><thead><tr><th width="227">Attribute</th><th>Description</th></tr></thead><tbody><tr><td>ExcelOutFile</td><td>The output file name</td></tr><tr><td>ExcelOutCount</td><td>Record count</td></tr></tbody></table>

&#x20;

## **Example**

This example demonstrates the ExcelReader and the ExcelWriter in a flow. The ExcelReader loads data from the sheets and The ExcelWriter writes those data to an excel file.

<figure><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image279.png" alt=""><figcaption></figcaption></figure>

This flow has two paths. One is single and the other is all. Single path will load the data from one sheet and write that data to the output excel file. All path will load the data from all the sheets and write all the input data to the output excel file.

### **Single**

#### Read Excel

This component reads an excel file and loads data from the sheet - Sheet1. The name of the excel file is parameterized. These parameters can come from the request.

| Input                                                                                                                                                                            | Output                                                                            |
| -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| ![Graphical user interface, text, application, email&#xA;&#xA;Description automatically generated](https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image280.png) | ![](https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image281.png) |

&#x20;

#### Excel Writer

| Input                                                                             | Output                                                                            |
| --------------------------------------------------------------------------------- | --------------------------------------------------------------------------------- |
| ![](https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image282.png) | ![](https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image283.png) |

This sample is invoked with these data.

&#x20;

<table><thead><tr><th width="179">URL</th><th>http://localhost:8080/api/ExcelReaderTest/v1?__RoutingPath=single</th></tr></thead><tbody><tr><td>Method</td><td>POST</td></tr><tr><td>Request Body</td><td><p>{</p><p>            "FilePath": "/data/send/",</p><p>            "FileName": "salaries.xlsx",</p><p>            "SheetName": "salaries"</p><p>}</p></td></tr></tbody></table>

&#x20;

&#x20;

### **All**

#### Read Excel

This component reads an excel file and loads data from all the sheets. The name of the excel file is parameterized. These parameters can come from the request. This component loads all the sheets from the input excel file.

| Input                                                                             | Output                                                                                                                                                     |
| --------------------------------------------------------------------------------- | ---------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image284.png) | ![Chart&#xA;&#xA;Description automatically generated with medium confidence](https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image281.png) |

The output data of this component are these.

| ![](https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image285.png) | <p>ExcelResultCount with the sheetname appended outputs are generated.</p><p>ExcelResultCount-<em>sheetname</em> : record count</p><p> </p> |
| --------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image286.png) | ExcelResultArray is a map of the data of the sheets                                                                                         |

&#x20;

&#x20;

#### Excel Writer

| Input                                                                             | Output                                                                                                                                                         |
| --------------------------------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ![](https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image287.png) | ![A picture containing application&#xA;&#xA;Description automatically generated](https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image283.png) |

The output data of the Writer component are these.

<table data-header-hidden><thead><tr><th width="272"></th><th></th></tr></thead><tbody><tr><td><img src="https://support.xnarum.com/download/manuals/ISM-Manual-2023.fld/image288.png" alt=""></td><td>ExcelOutCount with the sheet name appended outputs are generated.</td></tr></tbody></table>

&#x20;

This sample is invoked with these data.

&#x20;

<table><thead><tr><th width="185">URL</th><th>http://localhost:8080/api/ExcelReaderTest/v1?__RoutingPath=all</th></tr></thead><tbody><tr><td>Method</td><td>POST</td></tr><tr><td>Request Body</td><td><p>{</p><p>            "FilePath": "/data/send/",</p><p>            "FileName": "salaries.xlsx",</p><p>}</p></td></tr></tbody></table>
