# Group chained Inputs

Multiple input groups can be chained so that they are shown sequentially, through the use of a button. To use this feature the function `s.plt.generate_input_form_groups` has to be used. It eases the creation of multiple input forms groups, the user just has to define a dictionary where each key is the name of the group and the value is the list of input components. To activate the sequential show, the parameter `dynamic_sequential_show` has to be set to `True`.

The following example:

```python
form_groups = {
    f'form group {i}': [
      {
        'mapping': 'country',
        'fieldName': f'Country {i}',
        'inputType': 'select',
        'options': ['España', 'Colombia']
      },
      {
        'dependsOn': f'Country {i}',
        'mapping': 'city',
        'fieldName': f'City {i}',
        'inputType': 'select',
        'options': {
            'España': ['Madrid', 'Barcelona'],
            'Colombia': ['Bogotá', 'Medellin']
        }
      }
    ] for i in range(4)}

form_groups['Personal information'] = [
    {
        'mapping': 'name',
        'fieldName': 'name',
        'inputType': 'text',
    },
    {
        'mapping': 'surname',
        'fieldName': 'surname',
        'inputType': 'text',
    },
    {
        'mapping': 'age',
        'fieldName': 'age',
        'inputType': 'number',
    },
    {
        'mapping': 'tel',
        'fieldName': 'phone',
        'inputType': 'tel',
    },
    {
        'mapping': 'gender',
        'fieldName': 'Gender',
        'inputType': 'radio',
        'options': ['Male', 'Female', 'No-binary', 'Undefined'],
    },
    {
        'mapping': 'email',
        'fieldName': 'email',
        'inputType': 'email',
    }
]

form_groups['Other data'] = [
    {
        'mapping': 'skills',
        'fieldName': 'Skills',
        'options': ['Backend', 'Frontend', 'UX/UI', 'Api Builder', 'DevOps'],
        'inputType': 'checkbox',
    },
    {
        'mapping': 'birthDay',
        'fieldName': 'Birthday',
        'inputType': 'date',
    },
    {
        'mapping': 'onCompany',
        'fieldName': 'Time on Shimoku',
        'inputType': 'dateRange',
    },
    {
        'mapping': 'hobbies',
        'fieldName': 'Hobbies',
        'inputType': 'select',
        'options': ['Make Strong Api', 'Sailing to Canarias', 'Send Abracitos'],
    },
    {
        'mapping': 'textField2',
        'fieldName': 'Test Text',
        'inputType': 'text',
    },
    {
        'mapping': 'objectives',
        'fieldName': 'Objetivos',
        'inputType': 'multiSelect',
        'options': ['sleep', 'close eyes', 'awake']
    }
]

s.plt.generate_input_form_groups(
    order=0, form_groups=form_groups,
    dynamic_sequential_show=True
)
```

<figure><img src="/files/WZXa2dWQcPi7igYgbWYI" alt=""><figcaption><p>Initial result</p></figcaption></figure>

<figure><img src="/files/pQcVYADUJ0nsHqf1K2YJ" alt=""><figcaption><p>Result after clicking on the 'Next' button for each new group</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/group-chained-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.
