Dynamic parameters RPC

Hello makers,

I am currently developing an RPC that accepts a parameter of type ‘select’. My goal is for the result to dynamically adjust based on the provided parameter.
The problem is when i open the app i get “Bad request”

heres the rpc communication section:

{
	"url": "/recordTypes/{{parameters.type}}",
	"method": "GET",
	"response": {
		"iterate": "{{body.records}}",
		"output": {
			"value": "{{item.value}}"
		}
	}
}

and this is the parameter:

[
 {
    "name":"type",
    "label":"Type",
    "type":"select",
    "options":[
            {
            "value":"animal"
            },
            {
            "value":"person"
            }
        ],
    "required":true
    }   
]

and the module params are :

[
	"rpc://getparams"
]

If the rpc url is static it works fine but that is not what i need,
Any help would be greatly appreciated!

Hi Abdulkarim,

I believe something like this should fit the bill (you would need to use the “nested” directive)

[
 {
    "name":"type",
    "label":"Type",
    "type":"select",
    "options":{
		"store":[
            {"value":"animal"},
            {"value":"person"}
        ],
        "nested": [
                {
                    "name": "parameter_2",
                    "type": "select",
                    "label": "Parameter 2",
                    "required": true,
                    "mappable": false,
                    "options": {
                        "store": "rpc://getparams"
                    }
                }
            ]
		},
    "required":true
    }   
]
4 Likes

Hi thomas
this is exactly what im looking for!
Thank you!