Takes excel format files as input and fetches the required data from the file.
Configuration
The ExcelReader microservice can be configured using the Custom Property Sheet (CPS).
Figure 1: Custom Property Sheet
Error Handling Configuration
The actions to be taken when a particular error occurs can be configured using this attribute.
Click the ellipsis button against this property to configure Error Handling properties for different types of Errors. By default, the actions Log to error logs, Stop service and Send to error port are enabled.
Read File Details from Message Headers
This property is to read the file name and directory details from message headers.
Excel File Format
ExcelReader supports two formats of excel files as follows:
- Excel Workbook: Excel Workbook supports .xls and .xlsx formats of excel files.
- Excel Binary Workbook: Excel Binary Workbook supports binary (.xlsb) format of excel files.
File Name
Name of the excel file to be read. Suffix the extension of the file format such as .xlsx, .xls, and .xlsb with the name.
File Directory
Path of the excel file to be read.
Sheet Index
Sheet Index of the excel file to be read.
Response Size
Input the number of records to be aggregated in the response.
Data Index
The row from which the actual data starts.
Header Data Row
The row number where the Header data is present. This row will have the Column names.
Functional Demonstration
Create a flow using ExcelReader connecting to a Feeder microservice and a Display microservice.
Figure 2: Sample Event Process
Scenario 1 - Disabling the “Read File Details from Message Headers” property
Configure the ExcelReader microservice as shown in Figure 1. Send input using the Feeder microservice and display the output using the Display microservice.
Sample Input
Figure 3: Sample Excel File contents
Output
The data extracted from the excel file will be displayed in the Display window.
Figure 4: Output of the excel file displayed in the Display window
Scenario 2 - Enabling the “Read File Details from Message Headers” property
Configure the ExcelReader microservice as shown in the figure below. Select the input file and directory using the Feeder microservice as shown in the sample input below and display the output using the Display microservice.
Figure 5: Enabling “Read File Details from Message Headers” property in CPS
Sample Input
Use the same sample that is used in Scenario 1.
Feeder configuration
Go to the Message Details Configuration panel in the Feeder microservice and add the following values:
- FileName: Name of the excel file along with the extension (.xlsx/.xls/.xlsb).
- Directory: Path of the excel file.
Figure 6: Excel filename and directory path provided in the Message Details Configuration panel
Output
The data extracted from the excel file will be displayed in the Display window.
Figure 7: Output of the excel file displayed in the Display window
Scenario 3 - Reading Excel Binary Workbook
Configure the ExcelReader microservice as in the figure below. Select input from the Feeder microservice and display the output using the Display microservice.
Figure 8: Configuring Excel Binary Workbook in CPS
Sample Input
Figure 9: Sample Binary Excel file contents
Output
The data extracted from the xlsb excel file will be displayed in the Display microservice.
Figure 10: Output of the xlsb excel file displayed in the Display window