# Options filter: Filtering in forms

## What is options filter?

The *options filter* makes customizing fields within forms straightforward for those who want to add filtering without updating an options generator workflow. It takes inputs, filters them, and produces an output agnostic of the data source.

Options filter works for the following form field types:

* [Dropdown](https://docs.rewst.help/documentation/automations/forms/intro-to-forms#drop-down)
* [Radio Button](https://docs.rewst.help/documentation/automations/forms/intro-to-forms#radio-buttons)
* [Multi-Select](https://docs.rewst.help/documentation/automations/forms/intro-to-forms#multi-select)

Option generators are still a fantastic option for those who need a more powerful, in-depth, solution. We cover what these are and how to use them in Cluck University's [Rewst Foundations](https://learn.rewst.io/creating-an-option-generator) . If you’ve already taken our courses and want a refresher, see our documentation on option generators [here](https://docs.rewst.help/documentation/workflows/workflow-generated-options).

## Options filter guidance

* Modifying a form using the options filter will work for both parent and child organizations, as long as data formatting is set up the same way for both organizations.
* Add as many conditions as desired.
* Access the options filter feature in our standard form builder.
* Options filter works in the context of the current organization.

## Practical uses for options filter

* Say you offer 10 different types of licenses, but your users only ever use a single Business Premium type. Filtering down to just that license would simplify the list, and leave no room for error.
* Using a multi-select form field, present multiple licenses to a user to be filtered down to a specific set of licenses.
* Filter out admins from a total list of users, to create a cleaner list for copying into user onboarding.
* When offboarding a user, you may want to exclude a list of specific people to prevent accidental offboarding of key individuals, like the CEO.
* Hide on.microsoft email domains that are purely administrative, to provide a cleaner list.

### Detailed options filter example

You work at an MSP and are building a license request form for technicians. Your customer, XYZ Corp, only purchases Microsoft 365 Business Premium licenses, not E3, E1, or other license types. To prevent techs from accidentally selecting the wrong license type, which would lead to support tickets and billing issues, you want the drop-down in your form to only show Business Premium.

<figure><img src="/files/3H59A04Tv1xIcAlq6zad" alt=""><figcaption><p>Building the form with the different license types</p></figcaption></figure>

<figure><img src="/files/x21esZ3tp03o234djrg4" alt=""><figcaption><p>What is seen after clicking <strong>filter options</strong></p></figcaption></figure>

<figure><img src="/files/FqSab3LPWrZ1n9eHCAMF" alt=""><figcaption><p>Filtering using the <strong>simple</strong> logic option. The $.label equals Microsoft 365 Business Premium. Note that you haven't clicked <strong>apply filter</strong> on the bottom right, so there are still 4 filtered options shown under <strong>Dropdown Options</strong>.</p></figcaption></figure>

<figure><img src="/files/7WfVgAq0akbYLdWtRO3m" alt=""><figcaption><p>What you see after you click <strong>apply filter</strong>. Now, there's only 1 filtered option: Microsoft 365 Business Premium</p></figcaption></figure>

<figure><img src="/files/VjydT52R72334voPBN8u" alt=""><figcaption><p>A preview of the form, or a preview of what the end user would see. Only one option would display.</p></figcaption></figure>

## Options filter dialog

Click **Filter Options** under the **Dynamic Options** submenu of the right side forms menu. This will open the **Create Option Filters** dialog. In the dialog, you’ll see two submenus: **Dropdown Options** and **Options Filter**.

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

### All Options

The **All Options** drop-down selector holds all of the options which you’ve set in the standard form builder right side menu. Adding more options in that menu will populate those options into your drop-down selector.

<figure><img src="/files/AtuuEYvBTnGrWe1IBRtu" alt="" width="375"><figcaption></figcaption></figure>

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

The **Filtered Options** drop-down selector holds a list of your selected options after applying the filter. It acts as a preview for what to expect from your filtering.

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

If your form field uses a custom options filter, there will be a badge indicator in the top right of the field.

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

#### The JSON interface

Toggle from the default **Simple** view to the **JSON** view. This will switch to show the code of the filter. You may have a scenario where your desired filter is more complex than just label and value, such as ID. Using this code editor, filter out custom objects from complex queries.

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

#### Jinja for options filters

If you manage many organizations, use Jinja in options filters to scale filtering logic without manually configuring filters for every suborganization. When simple boolean logic operators feel limiting, go straight to Jinja for greater customization.

{% hint style="info" %}
The CTX variable you want to reference will always be called `options`.
{% endhint %}

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

### AND and OR conditional options filtering

{% hint style="info" %}
Using the options filter for forms will require a basic understanding of Boolean. If you’re new to the topic, be sure to complete our Clean Automation course in Cluck University before trying out this feature.
{% endhint %}

The options filter works off of two boolean operators, which are used to build queries for a variety of filtering situations.

1. **AND** sets that all conditions must be true to be filtered into the returned result. E.g., Red AND white would count only items with both those characteristics.
2. **OR** sets that either of several conditions can be true to be filtered into the return result E.g., Red OR white would count items with either of those characteristics.

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

Click **X** to the right of any added rule or group to delete it from your options filter list.

Click **+Rule** to add a filter field, which is customizable by a list of parameters. Choose from either **$.value** or **$.label**, then choose from the long drop-down list of conditions. E.g., **$.value equals `15`** would filter all results with a value of exactly 15.

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

In Boolean logic, a *group* refers to a set of terms or expressions that are treated as a single unit by using parentheses, allowing you to perform Boolean operations on them together. Essentially, it defines the order of operations by grouping certain elements within a complex logical statement.

When you want to combine multiple Boolean operations in a specific way, you enclose them within parentheses to indicate that these operations should be calculated first.

By grouping terms, you can control the order in which Boolean operators like AND and OR are applied. Use the +**Group** button to define your conditions more precisely. For example:

* Without grouping, A OR B AND C would be evaluated as: A OR (B AND C) due to precedence rules
* With grouping, (A OR B) AND C forces OR to be evaluated before AND.

## Forms and options filter

### Use the options filter in a form

1. Navigate to **Automations > Assets > Forms > + Add**.
2. Name your form, and click **Submit**.
3. Drag one of the three applicable form fields onto the form builder canvas. Remember, options filter is only available for Radio Buttons, Dropdown, and Multi-Select.
4. Click on the dragged form field to open the right side menu.
5. Click on **Filter Options**. This will open the **Create Option Filters** dialog.

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

6. Set up your desired filters using the AND and OR options, with relevant use of the **+Rule** and **+Group** buttons.
7. Click **apply filter** at the bottom right of your screen.
8. Click **Close** when finished. The option filter will automatically save and be applied to your form. Note that you’ll still need to click **Save** at the top right of your form builder screen to update these changes within your form.

![](/files/aw2tNK5lIrXnJiQCSI7W)

### Options filter and syncing of forms

The greatest advantage of the options filter is that it allows for the overriding of a form. Synchronized forms will block you from modifying attributes to prevent sync malfunction, by default. Under filter options in the form builder, you’ll find an **Override** button at the bottom right. Clicking will override this individual filter. Note that if you have multiple filters, and want to modify all of them, you’ll need to click **Override** for each filter.

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

### Org-based preview and org-specific instances

Use the org context drop-down selector to choose the child organization that you'd like to preview, and see how the form will function for that specific organization. Previews don't require cloning, and won't affect the saved form configurations except for the options filter. The options generator will display data as if the form were triggered in just that specific organization. The default-set options filter will be used if no custom filters were provided for the selected organization.

Click the drop-down selector to view and chose from your list of all total organizations.

<div data-full-width="false"><figure><img src="/files/K7fOjIkU64TPPyE5XvFa" alt=""><figcaption></figcaption></figure></div>

Selecting the preview organization sets the context of the form builder. and opening the preview dialog will use that organization's context to generate the correct preview, tailoring filtering logic for each instance without duplicating forms or unsyncing fields.

{% hint style="info" %}
By default, a field will inherit the parent organization's filter unless if it explicitly overridden.<br>
{% endhint %}


---

# 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/options-filter-filtering-in-forms.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.
