> ## Documentation Index
> Fetch the complete documentation index at: https://docs.markifact.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Pick Item from List

> Select a single item from any list using position, random selection, or custom index.

**Pick Item from List** extracts one specific item from a list. Use this to get the first campaign, select a random URL for testing, or retrieve specific items by position.

***

## When to Use It

* Get the latest campaign (last item) from API results
* Select a random URL for testing workflows
* Extract the first client from a list for priority processing
* Pick specific items by position for targeted operations

***

## Inputs

| Field         | Type   | Required | Description                                             |
| ------------- | ------ | -------- | ------------------------------------------------------- |
| **List**      | List   | Yes      | The list to pick an item from                           |
| **Pick Mode** | Select | Yes      | How to select the item                                  |
| **Index**     | Number | Yes\*    | Position of item to pick (\*For Custom Index mode only) |

### Pick Mode Options

| Mode             | Description                     | Use Case                    |
| ---------------- | ------------------------------- | --------------------------- |
| **First Item**   | Gets the first item in the list | Latest data, priority items |
| **Last Item**    | Gets the last item in the list  | Most recent entries         |
| **Random Item**  | Selects a random item           | Testing, sampling           |
| **Custom Index** | Pick by position (starts at 0)  | Specific targeting          |

***

## Credit Cost

Free to use - no credits required.

***

## Outputs

| Output            | Description                   |
| ----------------- | ----------------------------- |
| **Selected Item** | The picked item from the list |

***

## Understanding Index Numbers

When using **Custom Index** mode, remember that counting starts at 0:

```
List: ["Item A", "Item B", "Item C", "Item D"]
Index 0: "Item A" (first item)
Index 1: "Item B" (second item)
Index 2: "Item C" (third item)
Index 3: "Item D" (fourth item)
```

## FAQ

<Accordion title="What happens if I use Custom Index with a number that's too high?">
  If you specify an index that doesn't exist (like index 10 in a 5-item list), the workflow will fail with an error. Always ensure your index is within the list size range.
</Accordion>

<Accordion title="How do I know what index number to use?">
  Remember that indexing starts at 0. The first item is index 0, second is index 1, etc. For a 10-item list, valid indexes are 0-9. Use Count List Items first to check list size.
</Accordion>

<Accordion title="Can Random mode pick the same item twice if I run it multiple times?">
  Yes, random selection can pick the same item in different workflow runs. For unique sampling across multiple runs, consider using Remove Duplicates on your source list first.
</Accordion>

<Accordion title="What's the difference between First Item and index 0?">
  They're the same thing. "First Item" is just a user-friendly way to say "index 0". Both will pick the first item in your list.
</Accordion>

<Accordion title="Can I pick items from an empty list?">
  No, attempting to pick from an empty list will cause an error. Use Count List Items first to check if the list has items before picking.
</Accordion>
