> For the complete documentation index, see [llms.txt](https://docs.thingsup.io/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thingsup.io/actions/influxdb-read-query.md).

# InfluxDB Read Query Action

It provides a way to run InfluxDB Query. Before adding InfluxDB Read Action, user has to define a [**InfluxDB Connection**](/connections/influxdb-connection.md)**.** User need to provide following parameters to add InfluxDB Read Query Action.

#### Function

* User can JavaScript code to create dynamic query.
* Here the "payload" object and "Query" String object available in the code which is directly executed on InfluxDB Connection.
* "payload" object is supplied from Action Trigger like Rules, Action Command etc.

```
//Example 1

Query = "select Count(Result) from MY_MEASUREMENT WHERE time > now() - 24h GROUP BY time(30m) order by time desc"
```

```
//Example 2

Query = `SELECT * FROM "ienergyDigital" WHERE "Current" = 4.17`
```

#### Connection ID

User need to provide Connection ID of InfluxDB database connection.

![Add InfluxDB Read Query](/files/0jv7AIumUWTQoYbjTFyN)

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.
  {% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.thingsup.io/actions/influxdb-read-query.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
