# Redis Query Action

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

#### Command

&#x20;User need to provide a Redis Command in Lowercase. Find [Redis Commands](https://redis.io/commands).

#### Function

* User can write JavaScript code to create dynamic Redis query.
* Here the "payload" object and params Array objects available in this code which are directly executed on Redis Connection along with supplied command.
* "payload" object is supplied from Action Trigger like Rules, Action Command etc.

```
//Example 1

params.push(payload.key);

//Command is hgetall
```

```
//Example 2

params.push("getname");  //to get name of current connection
params.push("list");     // to get the list of client connections to the server

//Command is client
```

#### Connection ID

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

![Add Redis Query Action](/files/HAADQC1ItfFwWIbmyma9)

Please note the following points:

{% hint style="info" %}

* "payload" object is supplied from Action Trigger like Rules, Action Command etc.
* Data Response of Redis query will be available as Action Response.
  {% endhint %}


---

# Agent Instructions: 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:

```
GET https://docs.thingsup.io/actions/redis-query-action.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
