# SetValue

Required Frends version: 5.5+

Required .NET version: 6.0

Compatible Agents: Crossplatform

Source code: <https://github.com/FrendsPlatform/Frends.Redis/tree/main/Frends.Redis.SetValue>

{% tabs %}
{% tab title="Parameter: Input" %}

| Name                                     | Description                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                 |
| ---------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ValueType : `ValueType`                  | <p>Type of the value we want to save in Redis</p><p>Possible values:</p><ul><li><code>String</code>:</li></ul><p>Type of the value we want to save in Redis</p><ul><li><code>Hash</code>:</li></ul><p>Type of the value we want to save in Redis</p><ul><li><code>List</code>:</li></ul><p>Type of the value we want to save in Redis</p><ul><li><code>Set</code>:</li></ul><p>Type of the value we want to save in Redis</p><p><br>Default: <code>1</code><br>Example: <code>ValueType.String</code></p>                                   |
| Key : `String`                           | <p>Key to set</p><p><br>Default: <code>-</code><br>Example: <code>Foo</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                            |
| StringValue : `String`                   | <p>String value to set</p><p><br>Default: <code>-</code><br>Example: <code>Bar</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                                   |
| ListValue : `List<String>`               | <p>List value to set</p><p><br>Default: <code>-</code><br>Example: <code>\["Foo", "Bar"]</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                                         |
| HashValue : `Dictionary<String, String>` | <p>Dictionary value to set</p><p><br>Default: <code>-</code><br>Example: <code>{ { "Foo", "Bar" }, { "Moo", "Baz" } }</code></p>                                                                                                                                                                                                                                                                                                                                                                                                            |
| CollectionOperation : `Operation`        | <p>Operation that will be executed in case of collection-like type.</p><p>String values are always overwritten.</p><p>Possible values:</p><ul><li><code>Append</code>:</li></ul><p>Operation that will be executed in case of collection-like type.</p><p>String values are always overwritten.</p><ul><li><code>Overwrite</code>:</li></ul><p>Operation that will be executed in case of collection-like type.</p><p>String values are always overwritten.</p><p><br>Default: <code>1</code><br>Example: <code>Operation.Append</code></p> |
| ExpiryInSeconds : `Nullable<Int32>`      | <p>Time to live in seconds. Leave empty for infinite.</p><p><br>Default: <code>-</code><br>Example: <code>3600</code></p>                                                                                                                                                                                                                                                                                                                                                                                                                   |
| {% endtab %}                             |                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                             |

{% tab title="Parameter: Connection" %}

| Name                                  | Description                                                                                                                                                                                                                                                                                                                                              |
| ------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ConnectionMethod : `ConnectionMethod` | <p>Method to use to connect to Redis</p><p>Possible values:</p><ul><li><code>SimpleConnectionString</code>:</li></ul><p>Method to use to connect to Redis</p><ul><li><code>MicrosoftEntraId</code>:</li></ul><p>Method to use to connect to Redis</p><p><br>Default: <code>1</code><br>Example: <code>ConnectionMethod.SimpleConnectionString</code></p> |
| ConnectionString : `String`           | <p>Connection string to Redis.</p><p><br>Default: <code>-</code><br>Example: <code>127.0.0.1:6379</code></p>                                                                                                                                                                                                                                             |
| {% endtab %}                          |                                                                                                                                                                                                                                                                                                                                                          |

{% tab title="Parameter: Options" %}

| Name                             | Description                                                                                                                                                                                                       |
| -------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| ThrowErrorOnFailure : `Boolean`  | <p>True: Throw an exception.</p><p>False: Error will be added to the Result.Error.AdditionalInformation list instead of stopping the Task.</p><p><br>Default: <code>True</code><br>Example: <code>true</code></p> |
| ErrorMessageOnFailure : `String` | <p>Message that will be used when an error occurs.</p><p><br>Default: <code>-</code><br>Example: <code>Task failed during execution</code></p>                                                                    |
| {% endtab %}                     |                                                                                                                                                                                                                   |

{% tab title="Result: Result" %}

| Name                | Description                                                                                                                    |
| ------------------- | ------------------------------------------------------------------------------------------------------------------------------ |
| Success : `Boolean` | <p>Success flag<br>Example: <code>true</code></p>                                                                              |
| Error : `Error`     | <p>Error that occurred during task execution.<br>Example: <code>object { string Message, Exception AdditionalInfo }</code></p> |
| {% endtab %}        |                                                                                                                                |

{% tab title="Changelog" %}

## Changelog

### \[2.0.0] - 2026-03-03

#### Added

* Add support for more Redis value types (string, hash, list, set)
* **\[Breaking Change]** Rename Input.Value to Input.StringValue to distinguish between values of different types.
* Add option to define if collection-like values will be appended or overwritten.
* Add support for Microsoft Entra ID

### \[1.1.0] - 2025-07-31

#### Changed

* Make the default error message empty by default

### \[1.0.0] - 2025-05-13

#### Changed

* Initial implementation
  {% endtab %}
  {% endtabs %}
