Read Excel file

Description

Reads the content of an Excel file. The 'Save value to variable' block appears automatically when choosing the 'Read Excel file' function. It automatically saves the value to a variable. However, the block is not mandatory to use and can be removed from the workflow.

Parameters

Path

  1. Set a value: enables you to directly write the desired path. Clicking the 'Pick' button allows you to manually choose the path.

  2. Save the previous step result: chooses the previous function result as a path.

  3. Calculate a value: enables you to use available properties and methods to form a path.

Excel sheet name

  1. Set a value: enables you to directly specify the sheet name, for example, Employees.

  2. Save the previous step result: chooses the previous function result as the sheet name.

  3. Calculate a value: enables you to use available properties and methods to form the sheet name.

Get dictionary key

  1. Use table headers: the first row of the table is taken as a header.

  2. Use column letters: standard 'Excel' column names are taken as headers: 'A', 'B', 'C' and so on.

Comment

Contains an annotation to the block. The input text will be displayed inside the block above the function name.

Result

The excel data is stored in the excel_content variable by default. This variable represents a 'key-value' object, with a value being an array of 'key-value' objects. One object from the array corresponds to one row from the excel table.

For example, this record

Format of the variable with excel data ('use table headers' option enabled)
{
"List1": [
{
"Column 1": "Value (1,1)",
"Column 2": "Value (1,2)",
"Column 3": "Value (1,3)"
},
{
"Column 1": "Value (2,1)",
"Column 2": "Value (2,2)",
"Column 3": "Value (2,3)"
}
],
"List2": [
{
"Column 1": "Value (1,1)",
"Column 2": "Value (1,2)",
"Column 3": "Value (1,3)"
},
{
"Column 1": "Value (2,1)",
"Column 2": "Value (2,2)",
"Column 3": "Value (2,3)"
}
]
}

will represent the following table

List1
List2

Column 1

Column 2

Column 3

Value (1,1)

Value (1,2)

Value (1,3)

Value (2,1)

Value (2,2)

Value (2,3)

Column 1

Column 2

Column 3

Value (1,1)

Value (1,2)

Value (1,3)

Value (2,1)

Value (2,2)

Value (2,3)

Usage Examples

This function can be used whenever you need to read tables from Excel-files. A good usage example would be a settings file which can be represented in an Excel table form and read in the beginning of an algorithm execution.