Reports with patameters
Reports with parameters in Flowtrail AI enable you to create dynamic queries that can adapt to varying criteria, enhancing flexibility and precision in data retrieval. Configure parameters such as string, number, boolean, date, select, multiselect, and SQL query to tailor your dataset queries to specific needs. Each parameter can be customized with variable names, default values (if needed), and optional requirements. To add parameter in your query click on add parameter button from dataset page
Parameter Configuration
Clicking on the “Add Parameter” button will open a form where you can select from various parameter options. Flowtrail AI currently supports the following parameter types, each with customizable properties
Type of parameters
-
String
String parameter allows you to input text or alphanumeric characters. This parameter type is versatile for filtering or searching reports based on textual criteria.
-
Number
Number parameter allows you to input numerical values. This parameter type is ideal for filtering or analyzing reports based on numeric criteria such as quantities, amounts, or measurements.
-
Boolean
Boolean parameter provides a choice between two values, typically “true” or “false”. This parameter type is useful for filtering reports based on conditions that require binary outcomes, such as yes/no or on/off states
-
Date
Date parameter allows you to input a specific date or date range. This parameter type is essential for filtering reports based on temporal criteria, such as transactions within a certain time period or events occurring on a particular date.
-
Select
Select parameter allows you to choose a single option from a predefined list of choices. This parameter type is suitable for filtering reports based on categorical variables where only one option is required.
-
Multiselect
Multiselect parameter allows you to select multiple options from a predefined list of choices. This parameter type is ideal for filtering reports based on categorical variables where more than one option may be relevant.
-
SQL
SQL Query parameter allows you to input a custom SQL query directly. This parameter type is powerful for executing complex database queries within Flowtrail AI, allowing for highly customized data retrieval and manipulation based on specific SQL.
Parameter property
In Flowtrail AI, each parameter comes with specific properties that define its behavior and usage. Whether you’re setting up a string, number, boolean, date, select, multiselect, or SQL query parameter, understanding these properties ensures effective data handling and manipulation
-
Name
Each parameter must be uniquely identified by a variable name. This name serves as a distinct identifier within your report configuration. For example, use “someVariableName” without spaces to ensure clarity and compatibility with dataset operations.
-
Default value
Optionally, you can set a default value for the parameter. This value will be used if no specific input is provided when executing the report query.
-
Required
Specifies whether the parameter is mandatory for executing the report query. If marked as required, you must provide a value for the parameter before proceeding.
-
Select and Multiselect (Values Input)
For select and multiselect parameters, input the available options separated by commas. These options form the selectable choices when users interact with the parameter.
-
SQL Query (Syntax Example)
When using an SQL query parameter, ensure the syntax adheres to standard SQL format. Below is an example of how to structure an SQL query within Flowtrail AI:
This SQL query demonstrates how to retrieve data from a table. Replace table_name with the actual name of your table, displayName with the column representing labels or names, and valueName with the column representing values or identifiers.
For example: If you need to retrieve employee salary details based on specific employees from your database, you can integrate this query with parameters. Begin by creating a list of employees as parameters, then construct the query as follows:
Integrate Parameters in Queries
Added parameters are conveniently listed at the bottom of the query editor interface, providing easy access and visibility. You have the flexibility to include multiple parameters in a single query, allowing for tailored dataset retrieval to meet precise criteria. Additionally, parameters can be edited or deleted directly from the list, empowering you to refine queries swiftly in response to evolving requirements or conditions.
Format for integration
To integrate parameters within your SQL query, use the following format:
Replace '{{paramName}}'
with the actual parameter name defined in your parameter list. This syntax ensures that parameters are dynamically substituted with user-provided values at runtime.
Integration example
For instance, suppose you have parameters startDate and endDate representing a date range selected by the user. You can integrate them into your SQL query like this
This query calculates the total payroll amount (total_payroll) from the employee_payroll table, filtering results based on the paymentDate within the specified date range provided by the startDate and endDate parameters.
Troubleshooting and Additional Help
If you have more questions about the parameters or encounter any issues, please join our Discord channel or Email us for support.