> For the complete documentation index, see [llms.txt](https://cortex-docs.paloaltonetworks.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/customize-cortex-xsoar/customize-and-configure-cortex-xsoar/playbooks/extend-context/extend-context-in-a-playbook-task.md).

# Extend Context in a Playbook Task

You can extend context either in a playbook task, or directly from the command line. Whichever method you use, Cortex XSOAR recommends that you first run your command with the **`raw-response=true`** flag. This helps you identify the information that you want to add to your extended data.

1. Go to the **Advanced** tab of the relevant playbook task.
2. In the **Extend Context** field, enter the name of the field in which you want the information to appear and the value you want to return.

   The following image shows the result of the **`!IPReputation ip=20.8.1.5 raw-response=true`** command, which extends the context of the field name ip with the IP address 20.8.1.5.

   ![playbook-extend-context.png](/files/ubJhTsYLRxzNK2B6t1l1)

   To include more than one field, separate the fields with a double colon. For example: **`attributes=displayName::manager=attributes.manager`**
3. To output only the values for Extend Context and ignore the standard output for the command, select the **Ignore Outputs** checkbox.

   While this will improve performance, only the values that you request in the **Extend Context** field are returned. You cannot use Field Mapping as there is no output to which to map the fields.


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://cortex-docs.paloaltonetworks.com/xsoar-6-administrator-guide/6.14/customize-cortex-xsoar/customize-and-configure-cortex-xsoar/playbooks/extend-context/extend-context-in-a-playbook-task.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
