> 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 %}
