# Conditional fields

You'll often have forms that you want to use across a multitude of clients, but sometimes fields may not be relevant to them all. Rewst has *conditional fields* that can be used to determine whether you show another field.

## Conditional field example

In our example, we will look at the **Supervisor** field when creating a new user. In the image below, no Supervisor is set, and therefore the following field is another drop-down for further information.

<figure><img src="/files/9bARmdCnRBUYsyU5fo1e" alt=""><figcaption></figcaption></figure>

You can then see that if we add content to that supervisor drop-down, which is a list of users pulled dynamically from Microsoft365, a new field appears.

<figure><img src="/files/NRaLNrOvg22IEZA5owGe" alt=""><figcaption></figcaption></figure>

This boolean field is then checked on, which gives access to another relevant field.

<figure><img src="/files/sPypEDijRgDg2xDUr6jB" alt=""><figcaption></figcaption></figure>

Rather than giving fields to a user that bear no relevance, you only give them fields they must fill in.

These conditional fields are set by clicking the field on the form and clicking **Set Conditional Field**, which presents you with the below.

<figure><img src="/files/vrfIAZMBnFeWjbKfZbNg" alt=""><figcaption></figcaption></figure>

## Jinja for field conditions in forms

There are times where you may need to use criteria for a form condition that is not accounted for by the available drop-down selections, such as when organization information or organization variables are part of the criteria. At these times, you might instead opt to use a Jinja condition, such as `{{ ORG.VARIABLES.variable_name == "value" }}`.

Another case where the use of Jinja may be required is when multiple conditions need to be met, even if those conditions are normally available in the drop-down selections. An example of this would be `{{ (CTX.field_name_1 == "value_1") and (CTX.last_name != "value_2") }}` .


---

# 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.rewst.help/documentation/automations/forms/form-best-practices.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.
