Query
Filters a data table using a query string.
Common Properties
- Name - The custom name of the node.
- Color - The custom color of the node.
- Delay Before (sec) - Waits in seconds before executing the node.
- Delay After (sec) - Waits in seconds after executing node.
- Continue On Error - Automation will continue regardless of any error. The default value is false.
info
If the ContinueOnError property is true, no error is caught when the project is executed, even if a Catch node is used.
Inputs
- Table - The input data table to be filtered.
- Query String - The query string used to filter the table.
Options
- Output Type - Specifies whether to pass the table by reference or by value. Options are:
- Pass By Reference
- Pass By Value
Output
- Table - The resulting filtered data table.
How It Works
The Query node filters a data table using a query string. When executed, the node:
- Validates that the input table is not empty and is valid
- Checks if the table is a reference table and handles it appropriately
- Validates that the query string is not empty
- Converts the data table to a pandas DataFrame
- Applies the query string to filter the DataFrame
- Converts the filtered DataFrame back to the data table format
- Returns the filtered table
Requirements
- A valid input data table
- A valid query string compatible with pandas query syntax
Error Handling
The node will return specific errors in the following cases:
- Empty or invalid input table
- Empty query string
- Invalid table structure
- Invalid query string syntax
Usage Notes
- The Output Type option can be set to "Pass By Reference" for handling large tables more efficiently
- The query string should follow pandas query syntax
- Examples of query strings:
- "column_name == 'value'" - Filter rows where column_name equals 'value'
- "column_name > 10" - Filter rows where column_name is greater than 10
- "column1 == 'value1' & column2 > 5" - Filter rows matching multiple conditions
- The node supports all standard pandas query operations