Home > Forum > General > Read data from excel sheet

Read data from excel sheet
1

Is it possible to loop over all rows of an excel file?
I have an excel file with employees information(say 50 rows of employees). I want to navigate through each row, read and populate data in my form from excel columns and then trigger a workflow for each employee.

MVP

Hi Siddharth,

you can achieve this by importing the excel sheet and start sub workflows for each item list row.

Importing an excel sheet is explained here:
https://community.webcon.com/posts/post/importing-and-exporting-data-from-the-item-list/204

Multiple workflows can be started using the Start Workflows (SQL) action

If you search for this you will find a few results for example:

https://community.webcon.com/forum/thread/208?messageid=208
https://community.webcon.com/posts/post/starting-workflows-in-webcon-bps-actions/76

If you also want to store the started workflow ID in the item list row you can take a look here.
https://daniels-notes.de/posts/2021/series-expert-guide-part-7#starting-sub-workflows

Storing the workflow id will allow you to display the current step or other information in the item list and transform it into a dashboard.

Best regards,
Daniel

MVP
In reply to: Siddharth Nigam

Hi Daniel,

Thanks for your quick reply. Is it possible to automate this.
The excel file will be uploaded to any location example- HotFolder and then if it has 10 employee data rows, It should automatically initiate 10 instances of a workflow with pre-populated employee details.

Regards,
Siddharth

Hi Siddharth,

I wasn't aware of this, but there's an action to read data from an excel file
In this action you can define a reference in the excel file and the target field or item list.
An item list can be populated if you define a table in excel (format the area as a table).
See (1) in the image

The columns in the item list are populated based on the header. Similar to the import from excel action for an item list. Some recommendations:
1. Activate the "allow export" option on the item list to download a template
2. Boolean values need to be imported as 0 or 1 (2 in image)
3. If there is no header/misspelled header the column is not populated (3)
4. Verify whether you need to use . or , as a decimal separator.


If the user creating the excel file should use an easier template, you could create a second sheet on which the entered data of the user is transformed to the necessary format.

All in all you can:
- use the HotFolder to start the parent workflow
- add a timeout to move to the next step which populate the item list
- add another timeout to start the sub workflows

Of course you could do this all in one path, but I prefer to have a bit more control / error handling about such workflows.

Best regards,
Daniel