# Custom Functions

## Creating a Custom Function

In order to create a **Custom Function** follow the next steps :&#x20;

* Click on the **Add** button and select **Functions** in the opened list
* Set the **Name** of your function on the right properties panel
* Add a **Tag** to group your custom functions
* Choose if your function should be **Async** or not
* Add any **Parameters** you need
* Choose the **Return Type**&#x20;
* Write your code in the central editor
* Save by clicking on the top right button **Save**

<figure><img src="/files/ypkDpj82XBBgvtCft7tP" alt=""><figcaption><p>Example of a custom function that add two numbers and return the result as a string</p></figcaption></figure>

## Use a Custom Function

<figure><img src="/files/qccRaX8qSyQmIAH3I3tR" alt=""><figcaption><p>Example of use of a custom function that increment by 1 an observable on button click</p></figcaption></figure>


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.goril.app/main-pages/custom-code/custom-functions.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
