Not able to map parameter to RPC

:bullseye: What is your goal?

rpc://GetCustomFieldOptions expects custom_field_id to be passed.

How to pass the custom_field_info.custom_field_id to this rpc?

:thinking: What is the problem & what have you tried?

Here’s the code

                    "name" : "custom_field_values",
                    "label": "Custom Field Values",
                    "type": "array",
                    "advanced": true,
                    "spec":{
                        "type": "collection",
                        "spec":[
                            {
                                "name": "custom_field_info",
                                "type":"collection",
                                "spec":[
                                    {
                                        "name": "custom_field_id",
                                        "type": "uuid",
                                        "label": "Custom Field Id",
                                        "required": true,
                                        "rpc": {
                                            "label": "Find Custom Field",
                                            "url": "rpc://SearchCustomFields",
                                            "parameters": [
                                                {
                                                    "name": "query",
                                                    "label": "Custom Field name",
                                                    "type": "text"
                                                }
                                            ]
                                        }
                                    },
                                    {
                                        "name": "type",
                                        "type": "hidden",
                                        "label": "Type",
                                        "default": "text"
                                    },
                                    {
                                        "name": "name",
                                        "type": "hidden",
                                        "label": "Name",
                                        "default": "dummy"
                                    }
                                ]
                            },
                            {
                                "name": "option_value",
                                "label": "Option Value",
                                "type": "collection",
                                "spec": [
                                    {
                                        "name": "option_id",
                                        "label": "Option Id",
                                        "type": "uuid",
                                        "rpc": {
                                            "label": "Find Custom Field Option",
                                            "url": "rpc://GetCustomFieldOptions",
                                            "parameters": [
                                                {
                                                    "name": "query",
                                                    "label": "Option",
                                                    "type": "text"
                                                }
                                            ]
                                        }
                                    }
                                ]
                            }
                        ]
                    }
                }

You probably have to “nest” them.

Currently, custom_field_info and option_value are siblings (on the same level). Since custom_field_info is a pre-requisite of option_value, option_value has to be nested under custom_field_info.

For more information, see

Hope this helps! If you are still having trouble, please provide more details.

@samliew

Yes, I understand how nested implementation works but how do you solve in this case. Both custom_field_info and option_value are at the same level.