# InfluxDBv2 Read Query Action

This provides a way to run InfluxDbv2 read Query. Before adding InfluxDBv2 Read Query Action, user has to define a [**InfluxDBv2 Connection**](https://docs.thingsup.io/connections/influxdbv2-connection). User need to provide following parameters to add InfluxDBv2 Read Query Action.

#### Function

* User can write JavaScript code to create dynamic query.
* "payload" object and "Query" String object is available in this code which is directly executed on InfluxDB Connection.
* &#x20;Query should be written as per [Flux Specifications.](https://www.influxdata.com/products/flux/)

```
//Example 1

Query = `from(bucket: "bucket") |> range(start: -1h)`

```

#### Org

User need to provide Org name of InfluxDB database.

#### BeautifyResult

If set to Yes, it modifies raw data into more readable form. And if set to No, it keeps raw data from database

#### Connection ID

User need to provide a Connection ID of InfluxDBv2 database connection.

![Add InfluxDBv2 Read Query Action](https://365492316-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-M7aTljSjWsfbXZ_OP_9%2Fuploads%2FReRs7r8c0x0poNFjGcOj%2Finfluxdbv2_read.png?alt=media\&token=6c4309d5-e295-4781-a3ef-2b32cd5b9948)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of InfluxDB query will be available as Action Response.
* Only InfluxDB 2.X Databases are supported.
  {% endhint %}
