# Conditional values of fields

Simply put conditional setting means, filtering the data of a dropdown field based on the selection of an option in the previous dropdown field. When we say dropdown field, it means a select/multiselect/radio type of field where the user has a list of options to choose for the value of the field.

### How do we do this?&#x20;

Let's create two select type of fields. One is the field **Country** with options **India/USA/Canada** and the other field is **City** with options **Delhi/Mumbai/California/Washington/Toronto/Ottawa.**

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2Fsgykt6salF34PrJ1G8TT%2Fimage.png?alt=media&#x26;token=17fbbb62-5cd1-4ed4-9726-e4c8236f9138" alt=""><figcaption></figcaption></figure>

So, we set a mapping of options. If for the field **Country**, option **India** is chosen then only relevant options for the field **City** are shown to the user, that is **Delhi** and **Mumbai**. For the **Country** chosen **USA** the options shown for **City** are **California** and **Washington**, for the **Country** chosen **Canada** the options shown are **Toronto** and **Ottawa**.&#x20;

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FnbPlYigY6zWTngPaGw9I%2Fimage.png?alt=media&#x26;token=d7c8bfaa-df4b-4cac-a788-e9dd886ff2fb" alt=""><figcaption></figcaption></figure>

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FAjslADyf8SkeBhnSj8IO%2Fimage.png?alt=media&#x26;token=43e02935-ac92-4ce1-9ded-8d8e55b4617e" alt=""><figcaption><p><strong>Click on Map Values button to create the mapping</strong> </p></figcaption></figure>

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FSuMhDMPlw12mFS3qKUGf%2Fimage.png?alt=media&#x26;token=96d14a57-cbec-46de-8c22-604e0c3791dd" alt=""><figcaption><p>Once mapping is set, the user can the number of options mapped and the edit icon in case any change is required</p></figcaption></figure>

This can be carried further. If there is another dropdown field of **District,** then district options can be filtered based on the **City** options and so on.

### How this looks while filling up the form?

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2FcpeoHpDXWUJDgKy9ki8M%2Fimage.png?alt=media&#x26;token=e0906085-4187-47dd-84c6-c4d373e7a062" alt=""><figcaption></figcaption></figure>

When option **India** is selected then for the **City** only **Delhi/Mumbai** is shown to the user filling the form.

<figure><img src="https://4216568905-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-Mc6E3BSGr4i8kVdH38k%2Fuploads%2Fa6qdIVPa5uoVtOZsC8Pr%2Fimage.png?alt=media&#x26;token=fd85fd50-0124-47f3-87af-afb01f6eb5f9" alt=""><figcaption></figcaption></figure>

When option **USA** is selected then for the **City** only **California/Washington** is shown to the user filling the form.

### Why do we need this?

This functionality enables the user filling the form to just fill in the first dropdown field and the following dropdown fields automatically gets filtered data relevant to the selection made in the first dropdown. This improves both the user efficiency and system efficiency by reducing the amount of data to be addressed.

### Do I need to be connected to internet to be able to use this real time data filter?

Not really. The user creating the form has an option to save this mapping offline. That means, whatever mapping is created using this feature will be saved internally and the user filling the form can make use of this filter even when the internet is off and create a successful submission.
