# SLOTS

### Details

It also accepts a group of lists, returning, in this case, a group with slots in each of its entries.

### Syntax

**SLOTS(items, table, \[multiple])**

| **Argument name**                               | Description                                                                                                                                                 |
| ----------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------- |
| <p><strong>items</strong></p><p>Required</p>    | <p>List of items, or group of lists.<br>The list can contain duplicated items, in whose case they will weigh more and will be prioritized in the slots.</p> |
| <p><strong>table</strong></p><p>Required</p>    | <p>Table with the association between each item and its group.<br>An item can be also associated with multiple slots.</p>                                   |
| <p><strong>multiple</strong></p><p>Optional</p> | If *true*, each slot will accept more than a single item. It is *false* by default.                                                                         |

**Table syntax**

| Column name                                 | Description      |
| ------------------------------------------- | ---------------- |
| <p><strong>item</strong></p><p>Required</p> | Item identifier. |
| <p><strong>slot</strong></p><p>Required</p> | Slot identifier. |

### Examples

#### Example 1

If:

* items = \[p1, p2, p3, p4, p5]

And table is:

![table](https://1947171238-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrTaL6FQB3RzlkCwQfN%2F-MA6kOsK4Pw7yOdFh3Hh%2F-MA6nIGSvHQVYZeyvKlD%2Fimage.png?alt=media\&token=6bbcaa1d-6fee-4592-b145-088dfeaef8ce)

**SLOTS(items, table)** will return:

```
slot1: [p1]
slot2: [p2]
slot3: [p4]
```

**SLOTS(items, table, true)** will return:

```
slot1: [p1, p5]
slot2: [p2, p3]
slot3: [p4]
```

#### Example 2

If:

* items = \[p1, p2, p5, p3, p4, p5]

and table is:

![table](https://1947171238-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrTaL6FQB3RzlkCwQfN%2F-MA6kOsK4Pw7yOdFh3Hh%2F-MA6nIGSvHQVYZeyvKlD%2Fimage.png?alt=media\&token=6bbcaa1d-6fee-4592-b145-088dfeaef8ce)

**SLOTS(items, table, true)** will return:

```
slot1: [p5, p1]
slot2: [p2, p3]
slot3: [p4]
```

Note p5 has a higher priority because it appears twice in the list.

#### Example 3

If:

* items = {group1:\[p1, p2, p3, p4], group2:\[p5, p6, p7, p8]}

and table is:

![table](https://1947171238-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LrTaL6FQB3RzlkCwQfN%2F-MA6kOsK4Pw7yOdFh3Hh%2F-MA6pxGr7iEGZ8bGVfHe%2Fimage.png?alt=media\&token=f9239b25-2b3a-4b5e-a760-561f1bdad167)

**SLOTS(items, table, true)** will return:

```
group1:
    slot1: [p1]
    slot2: [p2, p3]
    slot3: [p4]
    
group2:
    slot1: [p5]
    slot2: [p6]
    slot3: [p6, p7, p8]
```
