docs/versioned_docs/version-2.17.0/data-sources/redis.md
ToolJet enables you to execute Redis commands on your Redis instances.
To establish a connection with the Redis global datasource, you have two options. You can either click on the +Add new global datasource button on the query panel or access the Global Datasources page from the ToolJet dashboard.
To connect ToolJet with Redis, you need to provide the following connection details:
:::info Click on Test connection button to verify if the credentials are correct and that the Redis is accessible to ToolJet server. Click on Save button to save the data source. :::
Here are some examples of Redis commands and their usage. You can refer to the Redis Official Documentation for a complete list of supported commands.
The PING command is used to test the connection to Redis. If the connection is successful, the Redis server will respond with PONG.
PING
The SET command is used in Redis to assign a value to a specific key.
SET key value
Example 1/2: When the input value contains spaces, you should encode the value before providing it as an input:
SET products {{encodeURI('John Doe')}}
The GET command is used in Redis to retrieve the value associated with a specific key.
GET key
Example 2/2: To retrieve a value that was previously encoded while setting, you can use transformations.
Enter the GET command in the editor:
GET products
Enable Transformations (JS) and use decodeURI:
return JSON.parse(decodeURI(data));