> For the complete documentation index, see [llms.txt](https://docs.thunkable.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.thunkable.com/snap-to-place/lists.md).

# Lists

## Create a List

You can create a list of variable lengths with the blocks below

### Empty List

Creates an empty list

![](/files/-MXl8OdoIMa_Ki-nKRU9)

### List of Specific Items

Allows you to specify what items in what order you want in your list

![](/files/-Lk0XW_jnh7R9qpDQliD)

### List of item repeated X Times

Creates a list of a given item repeated a specified number of times.

![](/files/-LAn671SwEPFsKGVlYsI)

### Make List from Text

This block lets you create a list from text and even lets you set delimiters i.e. ","

You can also use this block to make text from a list with a given delimiter

![](/files/-LAn672Np2rRx0Zi6E-L)

## Sort List

If you are importing a list from a Spreadsheet or other data source, it may be helpful to sort it in your app. You can sort a list alphabetically or numerically, ascending or descending

![](/files/-LAn673c7Iz4MNkGkltc)

![](/files/-MXl4KJxNCH0HVekwkPb)

![](/files/-MXl5oYtwOq970ruRds2)

## Analyze List

The following blocks analyze a list in different ways

### Length of List

![](/files/-MXl6zlUmz7liDDUYcrL)

Returns the length of a list.

### Is List Empty

![](/files/-MXl6p41bfE4iYz5K7sC)

Checks if a list is empty. Returns **true** or **false**.

### Find First/Last Occurrence

![](/files/-MXl5KgiSAtuhCg6yzGM)

Returns the position of the first or last occurrence of an item, where the index of the first item is 1. Returns 0 if the item is not in the list.

### Get Sublist

![](/files/-MXl5UvqbZEMubgrTsT8)

Returns a sub-list of items between two positions in a longer list.

### Does List contains Item

![](/files/-MXl6ELOrCMEdV4lxTFk)

Checks if a given list contains a given item. Returns **true** or **false**.

### Sum, Min, Max, Averages, Standard Deviation, Random Item

![](/files/-MXl8cDM8jkCJt3fA3Ft)

Returns the result of the chosen operation on a list of numbers. Returns **NaN** if the operation cannot be performed on the given list of values.

## Select from a List

Items in a list have an index number, the first item is 1, second is 2 and so on. Not only can you `select` an item from a list by number from the `front` but also from the `back`, the `first`, the `last` and also a `random` item. You can but `remove` it after you have selected it

![](/files/-MXl4_ZcLeOZHOAzFii5)

![](/files/-MXl4l7s9L3EptK2s_Kk)

![](/files/-MXl4rXmSPZV_s6UNI8B)

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

## Modify List

You can change an item in your list with the blocks below

### Insert At/Set

![](/files/-MXl7Vhjcbm375hAhYPp)

![](/files/-MXl7YpTDOi-KNSNgygA)

This block will either **insert** an item at the specified location, or **set** the item at the specified location to the new value.

### Remove Item from List

![](/files/-MXl9vl1J9bYAvrPuNSj)

Removes the item at the specified position from a list

## Shuffle List

Get a copy of a list with the items shuffled in a random order.

![](/files/-MXl7v1UO-uFE9h_ZUmS)
