skip to Main Content

How to read multiple data from an excel sheet in an iterative manner?

You can read excel data in an iterative manner with the help of for loop.

Lets say we have a sample excel file as shown below whose data you want to read one by one.

This image has an empty alt attribute; its file name is read2-1.png

To achieve this please follow the steps below:

Step 1: Load the excel file using loadexcel function.

This image has an empty alt attribute; its file name is image-320-1024x479.png

Step 2: Set a variable with sequence number to iterate the data one by one and to initialize the variable.

This image has an empty alt attribute; its file name is image-321-1024x476.png

Step 3: Get the number of rows in the excel sheet which will be used in the for loop as the end index.

This image has an empty alt attribute; its file name is image-247-1024x348.png

Step 4: Start for loop with startindex as 0 and end index as total number of rows in the excel sheet. Here it will be ${rowcount}

This image has an empty alt attribute; its file name is image-322-1024x473.png

Step 5: Set the sequence number variable again to be iterated inside for loop.

This image has an empty alt attribute; its file name is image-323-1024x473.png

Step 6: Define a variable and use getsetvalue function to get the data from the excel sheet.

This image has an empty alt attribute; its file name is image-326-1024x477.png

Here, excel data will be picked and will be stored in a variable data defined in Element Key. In each iteration of for loop one by one data will be picked and will be stored in the same variable.

After this you can apply your business logic to use this data.

Step 7: This step will mark the end of for loop.

This image has an empty alt attribute; its file name is image-329-1024x523.png

So the complete test case will look as below:

This image has an empty alt attribute; its file name is image-328-1024x523.png

To know more about the specific functions used in the above use case please refer this link.

Link: https://huloop.ai/docs/beatblip-commands/

Back To Top