> 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/functions.md).

# Functions

## Create a function

![](/files/-LAn66y6xaGnS4Hk6xQY)

To create a function, you will need to specify if it has any inputs and give it a name

![](/files/-LAn66yofZprsTAIvpdb)

One example of a function is below. This function will create and shuffle a list of items.

![](/files/-MXkxZznumk5UpU8CZI6)

After you have created your function, you can simply use it at any time using the function block you have named

![](/files/-MXkxr4I8faPM_UhjOWX)

## Create a function with an output

You can also create a function that returns a specific output.

![](/files/-MBnDFgRiSp4Hg9osvFn)

### Conditional Outputs

You can add multiple `return` blocks to your function. This allows you to return a different output based on some conditions.

For example, this function will take a rating out of 100, and return a description of the quality of the item being reviewed:

![](/files/-MBnEGfugDVrF6z8coeU)

The function will break when the `return` block is fired. For example, in the above example, if the quality rating is 100, the function will return **Perfect** and then stop. It will not run the other tests, and won't return **Excellent**. **Good**, **Fine**, etc.

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