# Reading Excel File Data

WARNING

This feature is available as part of vREST NG Pro/Enterprise version. Features like test suite level iterations, hook level iterations, feature related to outputVarName are introduced in vREST NG v2.5.0.

You can read the spreadsheet data by providing the CSV/XLSX file path in the field Read Excel File available in the Details tab of the test case or test suite or hook.

vREST automatically converts the CSV/XLSX data into the JSON array. Where each array item corresponds to the individual CSV/XLSX row. vREST stores this JSON array in a variable named data which you may feed to your test case or test suite or hook via the loop source property as shown in the above image. To change the output variable name used to store the excel sheet data, you may pass an argument outputVarName in the file path. e.g.

Read Excel File: {{$projectDir}}/data/api_test_data.xlsx?outputVarName=testData

By default, vREST will read the data from the first sheet in the spreadsheet file. If you want to read the data from a specific sheet in the spreadsheet then you may provide that option using a query parameter format in the file path:

Read Excel File: {{$projectDir}}/data/api_test_data.xlsx?sheetName=create_api

One example use case of this feature is that you may organize all your test data in a single spreadsheet file and each individual sheet in the spreadsheet file corresponds to the test data for each API.

For Create API:
Read Excel File: {{$projectDir}}/data/api_test_data.xlsx?sheetName=create_api

For Retrieve API:
Read Excel File: {{$projectDir}}/data/api_test_data.xlsx?sheetName=view_api

For Update API:
Read Excel File: {{$projectDir}}/data/api_test_data.xlsx?sheetName=update_api

For Delete API:
Read Excel File: {{$projectDir}}/data/api_test_data.xlsx?sheetName=delete_api

An example use case of this functionality is data-driven testing. For more information on this, please read our guide on Data Driven Testing.