# Working with Functions

### How to use Function(s) <a href="#how-to-use-function-s" id="how-to-use-function-s"></a>

The Flexi Kanban functions is very powerful and flexible tool that may help to build your complex logic and get rid of custom code in your application. You can use functions in the Flexi Kanban Dashboards, Forms and Actions.&#x20;

The Flexi Kanban application provides its own [library of functions](/references/functions.md), with the ability to extend the library with client custom functions. &#x20;

To use the function(s) or expression in your component configuration you have to cover the whole expression into "FORMULA\[]", except the places where the type of content is "Formula" (for example Action conditions).

```
Examples: 
1 + 2 = FORMULA[1 + 2]
The current year is "FORMULA[FORMAT({$system.Date}, 'yyyy')]"
```

### How to register custom Function <a href="#how-to-register-custom-function" id="how-to-register-custom-function"></a>

The Flexi Kanban application allows you define your own functions.&#x20;

To define your own function go to Setup->Custom Code->Custom Settings->KanBan Config List->Manage and click "New" button.

![](https://media.screensteps.com/image_assets/assets/006/511/079/medium/Custom_Function_2.png)

Here you can configure the custom function properties:

* Name  - custom function name. Should not contain spaces & special symbols. Preferable the upper case.\
  Example: CALCULATETOTAL
* Option 1 - apex class name that implements FLX\_KB.KanBanInterfaces.FunctionInterface interface and stores function code.\
  Example: MyCustomFunctionClass
* Option 2 - definition of the formula that will be shown as a formula example expression.\
  Example: CALCULATETOTAL(column\_id)
* Option 3 - category to put the formula in.\
  Example: Numeric
* Value - must be "Function"

And click "Save" button.

The configuration should looks like:

![](https://media.screensteps.com/image_assets/assets/006/511/095/medium/Custom_Function.png)

After that you will be able to find this function in all application formula builders and use it.

**The example of code that represents the custom function:**

{% code fullWidth="false" %}

```
public class MyCustomFunctionClass implements FLX_KB.KanBanInterfaces.FunctionInterface {
    public Object executeFunction(String name, List<Object> parameters, Map<String, Object> context) {
        return null;
    }
}
```

{% endcode %}


---

# 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.flexikanban.ai/components/actions-action-groups/basics/working-with-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.
