| token | Yes | token to authenticate to the database ([Intructions about how to create one](https://v2.docs.influxdata.com/v2.0/security/tokens/create-token/)) |
| organization | Yes | database organization name |
For InfluxDB use the `${paramName}` syntax for each parameter, and keep in mind that the values from that parameters must be from a trusted source as current
parameter substitution is subject to query injection attacks.
If `true` the query is expected to return a single scalar value that will be available to `result` channels as string, number, boolean,...
If the query can return several rows and/or several columns per row then it needs to be set to `false` and the result can be retrieved in `resultString`
In case `scalarResult` is `true` and the select returns multiple columns you can use that parameter to choose which column to use to extract the result.
## Channels
Query items offer the following channels to be able to query / bind them to items:
| execute | Switch | Send `ON` to execute the query manually. It also indicates if query is currently running (`ON`) or not running (`OFF`) |
| resultString | String | Result of last executed query as a String |
| resultNumber | Number | Result of last executed query as a Number, query must have `scalarResult=true` |
| resultDateTime | DateTime | Result of last executed query as a DateTime, query must have `scalarResult=true` |
| resultContact | Contact | Result of last executed query as Contact, query must have `scalarResult=true` |
| resultSwitch | Switch | Result of last executed query as Switch, query must have `scalarResult=true` |
| parameters | String | Contains parameters of last executed query as JSON|
| correct | Switch | `ON` if the last executed query completed successfully, `OFF` if the query failed.|
All the channels, except `execute`, are updated when the query execution finishes, and while there is a query in execution they have the values from
last previous executed query.
The `resultString` channel is the only valid one if `scalarResult=false`, and in that case it contains the query result serialized to JSON in that format:
Triggers when there's a need to calculate parameters before query execution.
When a query has `hasParameters=true` it fires the `calculateParameters` channel trigger and pauses the execution until `setQueryParameters` action is call in
In the case a query has parameters, it's expected that there is a rule that catches the `calculateParameters` trigger, calculate the parameters with the corresponding logic and then calls the `setQueryParameters` action, after that the query will be executed.
Use this action with care, because as the query is executed synchronously, it is not good to execute long-running queries that can block script execution.
### For Queries
#### setQueryParameters
It's used for queries with parameters to set them.
To execute the action you need to pass the parameters as a Map.