# Connecting Actions

With a single Action, your xRunBook can be a powerful tool.  But to unleash the full potential of unSkript, we can connect multiple Actions. We do this by placing the output of an Action into a variable, and accessing this variable in subsequent Actions.

Each Action can have it's output saved into a variable for later use. In this example the List of IAM users is saved in the List `users`:

<figure><img src="/files/6QAJjc6KTZ9XS8nf1Wqp" alt=""><figcaption></figcaption></figure>

### Example:

{% embed url="<https://youtu.be/Vo1wxjDCj2A>" %}

Our first step is to get a list of all the IAM users in our AWS account.  Drag the "List all IAM Users" Action to your RunBook.<br>

<figure><img src="/files/lnTLsmAyBmynrOJs1u2E" alt=""><figcaption><p>List all IAM Users Action</p></figcaption></figure>

Next, we'll configure this action with credentials (to access our AWS account).  There are no required inputs for this action, but let's name the output of the Action "users."

<figure><img src="/files/Ke2EjHTGUgvakiqe7706" alt=""><figcaption><p>Configuring the Credentials and output of the Action</p></figcaption></figure>

When we run this Action, the list of users will be saved in the List `users`.

<figure><img src="/files/XH80z025vQ4l7gEgNt1o" alt=""><figcaption><p>A partial listing of the users in the list.</p></figcaption></figure>

We can now use the data in `users` to build on our RunBook.

In step 2, we'll add a simple Action to the Runbook by clicking  `+ Add -> + Action` in the top navigation.

<figure><img src="/files/LMBalYeNMQrLrLATbSC1" alt=""><figcaption><p>Modifying the list</p></figcaption></figure>

This code loops through all of the users, and creates another list of the users with "doug" in the name.

Finally, let's send a message to Slack:

<figure><img src="/files/H8KwHx2sSOQNQXGB8wqa" alt=""><figcaption><p>Slack Configuration</p></figcaption></figure>

This Action takes the list of doug\_users, finds the length of the list and sends a message to the "devrel\_doug\_test1" channel announcing the number of users.

<figure><img src="/files/2nZFqGVnmowj3ydPg9ay" alt=""><figcaption><p>The Slack Message</p></figcaption></figure>

By naming the output of our Action, we can use that variable in subsequent Actions to manipulate the data, and complete further tasks. &#x20;


---

# Agent Instructions: 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:

```
GET https://docs.unskript.com/unskript-documentation/runbooks/xrunbooks/connecting-actions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
