# Conditional inputs

Input conditional dependent on other input results. To use it, the name of the parent input has to be included as the parameter 'dependsOn' of the child, like so:

<pre class="language-python"><code class="lang-python">report_dataset_properties = {
    'fields': [{
            'title': 'Conditional input form',
            'fields': [
                {
                    'mapping': 'country',
<strong>                    'fieldName': 'Country',
</strong>                    'inputType': 'select',
<strong>                    'options': ['España', 'Colombia']
</strong>                },
                {
<strong>                    'dependsOn': 'Country',
</strong>                    'mapping': 'city',
                    'fieldName': 'City',
                    'inputType': 'select',
<strong>                    'options': {
</strong><strong>                        'España': ['Madrid', 'Barcelona'],
</strong><strong>                        'Colombia': ['Bogotá', 'Medellin']
</strong>                    }
                }
            ]
        }
    ]
}

s.plt.input_form(
    order=0, options=input_data
)
</code></pre>

When the input has the parameter 'dependsOn', it has to define a set of options for every option in the parent input. In the case shown above the parent input has the options: 'España', 'Colombia', so the child input defines the list **\['Madrid', 'Barcelona']** for **'España'** and **\['Bogotá', 'Medellin']** for '**Colombia**'. The result is:

<figure><img src="/files/8ZpDKi3xFaIiTQajNvSQ" alt=""><figcaption><p>Resulting options in child when selecting 'España' in the parent input</p></figcaption></figure>

<figure><img src="/files/8Sr3viwKVQnsevz10GYC" alt=""><figcaption><p>Resulting options in child when selecting 'Colombia' in the parent input</p></figcaption></figure>


---

# 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.shimoku.com/dev/elements/charts/input-forms/conditional-inputs.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.
