# Lists

## Create a List

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

### Empty List

Creates an empty list

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl8OdoIMa_Ki-nKRU9%2FScreen%20Shot%202021-04-08%20at%2012.02.11%20PM.png?alt=media\&token=079fdfd3-1e0b-4fcc-a134-a42d4973d6bc)

### List of Specific Items

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

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-Lk0X7tybpogFcFD1jCe%2F-Lk0XW_jnh7R9qpDQliD%2Fimage.png?alt=media\&token=6dc5332a-c22b-4533-a38a-ab698e8840a4)

### List of item repeated X Times

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

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-LAn5wecEraNWaG7Ig2g%2F-LAn671SwEPFsKGVlYsI%2Fblocks-lists-%E2%9C%95-fig-3.png?generation=1524497159022763\&alt=media)

### 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

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-LAn5wecEraNWaG7Ig2g%2F-LAn672Np2rRx0Zi6E-L%2Fblocks-lists-%E2%9C%95-fig-8.png?generation=1524497156461835\&alt=media)

## 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

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-LAn5wecEraNWaG7Ig2g%2F-LAn673c7Iz4MNkGkltc%2Fblocks-lists-%E2%9C%95-fig-9.png?generation=1524497156340648\&alt=media)

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl4KJxNCH0HVekwkPb%2FScreen%20Shot%202021-04-08%20at%2011.44.22%20AM.png?alt=media\&token=c14b64bc-f0bf-4911-be84-a587e2d69042)

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl5oYtwOq970ruRds2%2FScreen%20Shot%202021-04-08%20at%2011.50.52%20AM.png?alt=media\&token=5c3b08f1-7641-400e-b4cf-ef9b61d0cf57)

## Analyze List

The following blocks analyze a list in different ways

### Length of List

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl6zlUmz7liDDUYcrL%2FScreen%20Shot%202021-04-08%20at%2011.56.00%20AM.png?alt=media\&token=7b4d652e-669b-4f9a-a0a8-a2d60cf2689b)

Returns the length of a list.

### Is List Empty

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl6p41bfE4iYz5K7sC%2FScreen%20Shot%202021-04-08%20at%2011.55.17%20AM.png?alt=media\&token=b18f37cf-dd42-4e35-98ef-a639c5b64fcb)

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

### Find First/Last Occurrence

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl5KgiSAtuhCg6yzGM%2FScreen%20Shot%202021-04-08%20at%2011.48.45%20AM.png?alt=media\&token=016433e9-7de5-493b-9b53-b400ccb75fe4)

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

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl5UvqbZEMubgrTsT8%2FScreen%20Shot%202021-04-08%20at%2011.49.30%20AM.png?alt=media\&token=a16d3e42-4a37-44e0-b08c-31b10b9ca308)

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

### Does List contains Item

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl6ELOrCMEdV4lxTFk%2FScreen%20Shot%202021-04-08%20at%2011.52.43%20AM.png?alt=media\&token=e958006e-ef19-4cf2-b791-9e3b0ae361f5)

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

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

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl8cDM8jkCJt3fA3Ft%2FScreen%20Shot%202021-04-08%20at%2012.03.09%20PM.png?alt=media\&token=6dd3277e-c7d6-49a7-8ae8-06c60a257065)

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

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl4_ZcLeOZHOAzFii5%2FScreen%20Shot%202021-04-08%20at%2011.45.29%20AM.png?alt=media\&token=ef1f9f91-444e-45f0-a3b5-a44bbf1b35c4)

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl4l7s9L3EptK2s_Kk%2FScreen%20Shot%202021-04-08%20at%2011.46.14%20AM.png?alt=media\&token=171b53f5-4abb-451a-81d6-4aaa5c11376f)

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl4rXmSPZV_s6UNI8B%2FScreen%20Shot%202021-04-08%20at%2011.46.44%20AM.png?alt=media\&token=897e3312-f51b-46c3-9739-157fe463a100)

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

## Modify List

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

### Insert At/Set

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl7Vhjcbm375hAhYPp%2FScreen%20Shot%202021-04-08%20at%2011.58.18%20AM.png?alt=media\&token=99a14dc6-bf3d-406d-b979-4ce55156c451)

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl7YpTDOi-KNSNgygA%2FScreen%20Shot%202021-04-08%20at%2011.58.31%20AM.png?alt=media\&token=95d6b4f7-e1d0-4bab-826c-0376abb827b1)

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

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl9vl1J9bYAvrPuNSj%2FScreen%20Shot%202021-04-08%20at%2012.08.53%20PM.png?alt=media\&token=e72dd2b0-6d24-4f6f-9263-75751751f768)

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.

![](https://689802330-files.gitbook.io/~/files/v0/b/gitbook-legacy-files/o/assets%2F-LAn5scXl2uqUJUOqkJo%2F-MXl42CqbHeAZTsv4vBu%2F-MXl7v1UO-uFE9h_ZUmS%2FScreen%20Shot%202021-04-08%20at%2012.00.06%20PM.png?alt=media\&token=7254147c-c128-43dd-8390-63ad9c24fdbd)
