# 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="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2FFq4FCERZbkF4B334wZFJ%2Fimage.png?alt=media&#x26;token=3ad125ff-6072-43c8-ac61-66a2877bace8" 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="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2F5EHIyrCYfRVZU0NLi1Us%2Fimage.png?alt=media&#x26;token=5ed019d7-0f7d-4494-a2d8-878d6b77c773" 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="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2FTJCOJHUPbgL5iDMlX4ji%2Fimage.png?alt=media&#x26;token=955df5c4-9f94-4c7d-b161-2d27ce551dd8" 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="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2FfqJCFW9wQl2KejXfdI37%2Fimage.png?alt=media&#x26;token=eaaa245b-8618-43cb-9441-a1ea4c5515c1" 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="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2FydtKc9qp6BiUzfquw244%2Fimage.png?alt=media&#x26;token=754b7770-7045-4c3c-813b-64dc8e6e68a8" 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="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2F7tTkBV1jlbRGbSsvkMuX%2Fimage.png?alt=media&#x26;token=44fb2406-2c27-4f73-a674-9a70512b259b" 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="https://491011674-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2Fm4p7lGuBAXN5jCVyoF7P%2Fuploads%2FAjvPUUk08qiqYujYDNw7%2Fimage.png?alt=media&#x26;token=16df554e-8246-4915-a6d5-30d3591b38fd" 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;
