The ExcelToMapGen Generator reads data from one or more columns within a specified Excel file and saves it to memory. Once the data is in memory, the ExcelFromMapGen Generator is used to get the data from a particular column by Column Name for each Attribute.
Note: Reading data from an Excel File (using ListExcelGen or another Excel Generator) is slower than reading data from a plain delimited file (ListCSV or CSVToMap, etc.).
In This Article
- ExcelToMapGen Parameters
- ExcelFromMapGen Parameters
- Preview Showing Empty Values - List Parameter
- Use Case Example
Use Case Example
A tester wants to populate values from an Excel file to different AttribDomain Attributes ExcelToMapGen and ExcelFromMapGen.
They need to query the Product, Price, and Qty columns within the Excel spreadsheet below and then populate the data for other Attributes.
The tester has created a Product Domain that contains five Attributes: id, productDetails, product, price, and qty. The Excel file will be read and saved into a memory map for the productDetails Attribute.
The Product Domain loopCount has been set to '6', meaning that the three data rows will be used twice for the output.
Note: The productDetails Attribute is not visible because it will only be used to store the data in memory and is not needed for the output.
For the productDetails Attribute, the tester has added the ExcelToMapGen Generator and modified the following parameters:
- fileName - Entered Excel file name (e.g., ExcelSample.xlsx).
- sheetName - Entered sheet name (e.g., Sheet1)
- columnNames - Entered three lines (Product, Price, Qty).
- bufferSize - Entered the value 3 because three rows of data are in the sample file.
Note: Make certain the entered column names match the column names in the Excel file sheet.
The ExcelFromMapGen Generator has been assigned to three Attributes: product, price, and qty. Make sure the column name matches what is in the Excel file and what was entered for the ExcelToMapGen Generator.
The output below is in delimited file format.