Select Excel Records
Description
The Select Excel Records activity reads records from a worksheet in a Microsoft Excel workbook and returns the selected data as a DataTable.
Use it to select and rename columns, configure output data types, add computed columns, filter records, sort results, and read all matching records or a specific page. Like Read From CSV, it lets you define the output table before using the data in subsequent workflow activities.
Common settings
Use Process Data to bind supported inputs to workflow values or upstream outputs. See Common Activity Features for shared execution, error-handling, and output-persistence settings. Availability depends on the activity.
Design-Time Configuration
Open the activity configuration and use the Parameters tabs: Inputs, Table Structure, Filter, Sort, and Pagination. Click Preview to review the results of the current configuration, then click OK to save.
Inputs
Workbook File
Required file reference to the Excel workbook to read. Bind this field to a file output from a previous activity, such as Get File.
Password
Password used to open a password-protected workbook. Leave this empty when the workbook does not require a password.
See Excel Workbook Configuration for details about workbook file references and passwords.
Sheet Reference
Select how to identify the worksheet:
- By Name: enter the worksheet's name in Sheet Name. An empty name uses the active worksheet.
- By Index: enter the zero-based Sheet Index. Index
0identifies the first worksheet.
See Excel Worksheet Selection for shared worksheet selection behavior.
Has Header Row
Enable this option when the first row contains column names. The header row identifies the source columns and is excluded from the data records.
Disable it when the first row contains data. Review the source column identifiers in Table Structure before configuring mappings and filters.
Table Structure
Define the columns to include in the output DataTable. Click Detect to populate the structure from worksheet data, then review the detected columns and types. In particular, check columns that contain mixed values or dates and numbers stored as text.
| Setting | Description |
|---|---|
| Sheet Column | Source worksheet column to read. |
| Output Column | Column name to use in the returned DataTable. |
| Type | Target data type for the output column, such as String, Int32, or Boolean. |
| Format / Expression | Format or expression used for the column, where applicable. Configure it to match the selected type and the intended output value. |
| Actions | Remove a column mapping using its delete control. |
Keep the mappings needed by subsequent activities and remove unwanted mappings. Use Output Column to give a source column a more suitable name without editing the workbook.
Computed columns
Click Add Computed Column to add a calculated output column. Give it an output name, choose the appropriate type, and configure its expression. Computed columns let you include derived values alongside the selected worksheet columns.
Table structure controls
| Control | Purpose |
|---|---|
| Detect | Populate the table structure from worksheet data. |
| Clear | Remove the configured table structure. |
| Add Computed Column | Add a calculated column to the output. |
| Preview | Inspect the results using the current configuration. |
Filter
Define conditions that determine which records to include.
- Click Add Rule to add a condition on a column.
- Choose AND when all conditions in a group must be satisfied.
- Choose OR when any condition in a group can be satisfied.
- Click Add Ruleset to create a nested group of conditions with its own AND or OR relationship.
For example, use an AND group to select test cases where Skip equals false and ExpectedDurationInMin is greater than 0.
Leave the filter empty to select records without restricting them by column values. Pagination still controls how many records are returned.
Sort
Click Add Sort to configure a column and its sort direction. Add further sort entries when records should be ordered by more than one column.
For example, sort by ExpectedDurationInMin in ascending order to process shorter test cases first. When reading multiple pages, use a consistent order and include a column with unique values to distinguish records with equal sort values.
Pagination
| Setting | Description |
|---|---|
| Read All | Turn on to return all records that match the selection. Turn off to return a single page. |
| Page Number | The 1-based page to return when Read All is off. Use 1 for the first page. |
| Page Size | The number of records per page when Read All is off. |
To return the first 100 matching records, turn Read All off, set Page Number to 1, and set Page Size to 100.
For example, page 2 with a page size of 100 selects records 101–200 of the filtered, sorted results, or the remaining records if fewer are available. These positions refer to result records, not Excel worksheet row numbers.
To process successive pages, bind Page Number to a workflow variable and increment it between executions. Keep the workbook data, filter, sort order, and page size consistent while paging.
Outputs
Data Table
Returns the selected records with the output column names, types, and computed columns configured in Table Structure. Use the table in subsequent activities for iteration, transformation, or reporting.
Execution settings
Configure Wait All Incoming when execution paths converge, and On Error for failure handling. Select Inherit where available to use the workflow-level error policy.
Example: Select test cases to execute
Assume the workbook contains a worksheet named TestCases with columns TestCase, ExpectedDurationInMin, and Skip.
- Add Select Excel Records from the Microsoft Excel category.
- In Inputs, bind Workbook File to the workbook file reference. Select By Name, enter
TestCasesin Sheet Name, and enable Has Header Row. - In Table Structure, click Detect and review the mappings. Use String for
TestCase, Int32 forExpectedDurationInMin, and Boolean forSkip. - In Filter, add a rule where
Skipequalsfalse. - In Sort, add an ascending sort on
TestCase, assuming each test-case name is unique. - In Pagination, turn Read All off, set Page Number to
1, and set Page Size to100. - Click Preview to check the selected columns, converted values, filter, and ordering. Click OK to save.
- Use the returned Data Table to process the selected test cases.