--- alias: user-guide-automation-task-core-store tags: - automation tasks description: "This task stores values in a shared context, offering persistent or temporary storage options" --- # Store Data :iot-store-data-lg: The `Store Data` task allows you to store values in a shared context that can be retrieved later using the `Retrieve Data` task. It supports both persistent and temporary storage modes. ## Inputs | Name | Data Type | Description | |-----------------|------------|------------------| | `` | `` | Value to store | | Activate | `any` | Store all values | ## Outputs | Name | Data Type | Description | | ------------| ----------- | -----------| | Success | `Boolean` | *True* value emitted when the values are stored | | Error | `Error` | Error that occurred during the processing of this task | ## Settings On the General Tab, you have the usual settings and the following setting: | Name | Data Type | Values | Default | Description| | ------------ | ----------- | -----------| ----------- | ----------- | | Working Mode | `enum` | `StoreOnValueChange`
`StoreOnActivate` | `StoreOnValueChange` | Expected behavior to store the data | ![Screenshot showing a table with columns labeled Name, Data Type, Values, Default, and Description.](../images/image53.png) On the Inputs tab, each item that belongs to the custom list has the following settings: | Name | Data Type | Values | Default | Description | | ------------ | ----------- | --------| ----------- | ----------- | | Name | `String` | | | Name that will identify the stored value | | Identifier | `any` | | | Unique identifier that will represent the value | | Type | `Long`
`Decimal`
`DateTime`
`Boolean`
`String`
`Integer` | | | Type of data expected to be stored | | Collection Type | `None`
`Array`
`Map` | | `None` | Collection Type of data to store (not yet used) | | Storage | `enum` | `Persistent`
`Temporary` | | Retention type of the store | ![Screenshot showing storage settings with options for persistent and temporary retention types.](../images/image54.png) ## Behavior If `Working Mode` is set to `StoreOnActivate` then the data will be stored only when the `Activate` input is triggered and all inputs will be stored at the same time. If `Working Mode` is set to `StoreOnValueChange` then each and every time the input value is changed, it will be immediately stored. If the `Storage` is set to `Temporary`, then the data will only be stored during the lifetime of the Automation Controller process. The moment it is closed or restarted, the data will be lost. The `Identifier` is supposed to be unique throughout the entire controller. Duplicate identifiers will remain with the latest values, no matter who wrote it. !!! note The data is persisted within a store unique for the Automation Controller Instance. This means that changing versions will not affect the data. Terminating an Automation Controller Instance will render the data inaccessible. ## Remarks Writing `` into a Data Item will remove it from the store. Make sure the identifiers are unique within the controller. The persisted data will be stored in the persistence entry defined in the Automation Manager configuration file.