> For the complete documentation index, see [llms.txt](https://docs.shimoku.com/dev/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.shimoku.com/dev/elements/charts/input-forms/conditional-inputs.md).

# 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
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## 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, and the optional `goal` query parameter:

```
GET https://docs.shimoku.com/dev/elements/charts/input-forms/conditional-inputs.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

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.
