Search code examples
make.comintegromat-apps

Nested fields of a select parameter in custom Integromat app


I have an API endpoint that can receive an object's ID or name, but not both. I'm trying to make nesting within the select parameter. When I use the code below, in the scenario, the nested fields don't appear. Am I missing something?

[
    {
        "type": "select",
        "name": "searchBy",
        "label": "Select",
        "options": [
            {
                "label": "ID",
                "nested": [
                    {
                        "name": "id",
                        "type": "number",
                        "label": "ID"
                    }
                ]
            },
            {
                "label": "Name",
                "nested": [
                    {
                        "name": "name",
                        "type": "text",
                        "label": "Name"
                    }
                ]
            }
        ]
    }
]

Solution

  • Both of the select options ("label": "ID" and "label": "Name") are missing the value field, so even when you choose one of them, the platform behaves as if nothing was selected and the nested fields remain hidden.

    To fix the problem, simply add "value": "id" and "value": "name" below the corresponding labels, as shown in the following documentation example. Please note, the values do not need to correspond to the nested field names, they just need to be unique within the list of the parent select options.

    The resulting code will look like this:

    [
        {
            "type": "select",
            "name": "searchBy",
            "label": "Select",
            "options": [
                {
                    "label": "ID",
                    "value": "id",
                    "nested": [
                        {
                            "name": "id",
                            "type": "number",
                            "label": "ID"
                        }
                    ]
                },
                {
                    "label": "Name",
                    "value": "name"
                    "nested": [
                        {
                            "name": "name",
                            "type": "text",
                            "label": "Name"
                        }
                    ]
                }
            ]
        }
    ]