> For the complete documentation index, see [llms.txt](https://developer.collibra.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://developer.collibra.com/workflows/designing-workflows/forms/form-examples/javascript-in-expressions.md).

# JavaScript in expressions

You can also use JavaScript to create your expressions. For example, if you want to return the lower-case version of a string, simply add toLowerCase() at the end of your value: `{{name.toLowerCase()}}`.

It is also possible to chain several JavaScript functions. The following expression turns the name of a person into an email address: `{{name.replace(' ', '.').toLowerCase() + '@collibra.com'}}`.

## Truthiness and Falsiness

JavaScript knows the concept of "truthy" and "falsy". This differs from the strict definition where a value is only true if it evaluates to a true boolean value.

A value in Form Expressions evaluates to true if:

* A value is the Boolean value `true`.
* A value is a string, such as *Product A*.
* A value contains an object, such as a date.
* A value is a number, positive or negative, with or without fraction.
* A value is an object `{}` or an array `[]`.

A value in Form Expression evaluates to false if:

* A value is the Boolean value `false`.
* A value is `null`.
* A value is `undefined`.
* A value is `0`.
* A value is an empty string, such as `''` or `""`.

{% tabs %}
{% tab title="Example" icon="glasses-round" %}
You want to change the state of an input field from disabled to enabled after selecting an asset from the asset picker. The variable defined in **Value** for the asset drop-down and any other drop-down component stores the ID of the selected option, for example `{{asset}}`.

The concept of "truthy" and "falsy" means you don't have to build a complex condition to evaluate the asset ID to `true`. To change the state of an input field from disabled to enabled, pass the variable of the asset picker to the **Enabled** property of the text input: `{{asset}}`.
{% endtab %}
{% endtabs %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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://developer.collibra.com/workflows/designing-workflows/forms/form-examples/javascript-in-expressions.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.
