# Remove from a Cache Variable Value

Uses the REST API to remove one specific value from an Event Orchestration Cache Variable array, leaving the rest intact.


> **Availability:** See the [Incident Workflow Actions Overview table](/workflow-actions) for the plans this workflow is available on.

## Description

Use the REST API to remove a specific value from an existing [Event Orchestration Cache Variable](/ai-automation/aiops/event-orchestration/cache-variables). This will only remove the specified value, and will not delete the entire value. The comparison is case-insensitive and will remove all occurrences of the specified value. In addition, the TTL counter for the Cache Variable will reset only when the value has been successfully removed. In order to publish a usable action, you must have API access with WRITE permissions for the Event Orchestration that the Cache Variable belongs to.

> **Action Limitations:** - The existing Cache Variable value must follow JSON array formatting for the action to successfully complete:
>   - `'["SERVER1","\"SERVER\" 2","SERVER3"]'`
> - The Cache Variable being set must be of External Data Variable Type and String Data Format.
> - The value set must match a String [Data Format](/ai-automation/aiops/event-orchestration/cache-variables#step-2-create-a-new-cache-variable).
> - The Cache Variable being set will follow all existing [Product Limitations](/ai-automation/aiops/event-orchestration/cache-variables#product-limits).
> - If the provided string does not exist in the Cache Variable, the workflow will not attempt to update the value.

### Examples

See how you can use this action within a larger use case to [stop system events from auto-resolving high priority incidents](/ai-automation/aiops/event-orchestration/examples#disable-system-auto-resolve-for-high-priority-incidents).

## Prerequisites

1. Create a new [API Access Key](/account-admin/api-access-keys#generate-a-user-token-rest-api-key) with WRITE access to the relevant Event Orchestration. Ensure that you save this API Key during the creation process, as you will not have access to the value again.
2. Create a [Web API Workflow Integration](/ai-automation/automation/incident-workflows/workflow-integrations#create-a-workflow-integration). The fields within the Web API Workflow Integration must follow specific configurations for this action:
   1. **Authentication Headers**: Use the exact format below and replace “VALUE OF API KEY HERE” with the API Access Key generated above:
      1. `Authorization: Token token={VALUE OF API KEY HERE}`
   2. **Allowed Hostnames**: Ensure that you include your PagerDuty account’s [subdomain](/account-admin/account-subdomains) as one of the hostnames:
      1. `*.pagerduty.com`
3. Create a [Cache Variable](/ai-automation/aiops/event-orchestration/cache-variables) with an [External Data Variable Type](/ai-automation/aiops/event-orchestration/cache-variables#step-2-create-a-new-cache-variable) in an existing [Event Orchestration](/ai-automation/aiops/event-orchestration#configure-event-orchestration).

## Instructions

1. If you have not done so already, please follow our instructions to [Create an Incident Workflow](/ai-automation/automation/incident-workflows#create-an-incident-workflow).
2. Select a Conditional or Manual [Trigger](/ai-automation/automation/incident-workflows#add-triggers), depending on if you’d like the Cache Variable value to be updated automatically or manually by a user
3. When you are prompted to add actions, select **this action**.
4. Enter the following **Inputs** and then click **Save**. Continue following instructions to **Publish** the Workflow. When the action runs, you will see the **Outputs** listed below.

## Inputs

> **Field References:** Fields with the **\{+\}** icon accept [Field References](/ai-automation/automation/incident-workflows#field-references), which can be useful for referencing incident data or outputs created in prior workflow steps. To add Field References, click **\{+\}**, or enter `{{`, and select relevant fields. Refer to the [Field References](/ai-automation/automation/incident-workflows#field-references) article for more information.

| Name                     | Description                                                                                                                                                                                                   |
| :----------------------- | :------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ |
| Authentication Headers   | Select the connection created in [Prerequisites](#prerequisites).                                                                                                                                             |
| Event Orchestration Type | Select the type of Event Orchestration (Global or Service) that the Cache Variable belongs to.                                                                                                                |
| Event Orchestration      | Select the Event Orchestration that the Cache Variable belongs to.                                                                                                                                            |
| Cache Variable           | Based on the selected  Event Orchestration, select the Cache Variable whose value the workflow will update. **Note**: You can only select variables with External Data Variable Type and String Data Format . |
| Value                    | Enter the value that shall be removed from this Cache Variable. This value must be the same data format as the Cache Variable.                                                                                |

## Outputs

| Name           | Description                                                                                                                                   |
| :------------- | :-------------------------------------------------------------------------------------------------------------------------------------------- |
| Value          | A string representation of the new value of this Cache Variable.                                                                              |
| Details        | Details about the new value of this Cache Variable. **Example**:   `{ "cache_variable_data": "hello", "updated_at": "2025-02-21T23:46:08Z" }` |
| Result         | Value that shows if the action was successful or not. Either "Success" or "Failed".                                                           |
| Result Summary | Brief description of what the action did or if it failed.                                                                                     |
| Error          | Brief description that is populated if the action failed.                                                                                     |
