1

我正在尝试从 RPC动态呈现 a 的spec(规范) 。collection无法让它工作。在这里,我附上了“模块->可映射参数”和“远程过程->通信”的代码。

模块 -> 可映射参数

[
    {
        "name": "birdId",
        "type": "select",
        "label": "Bird Name",
        "required": true,
        "options": {
            "store": "rpc://selectbird",
            "nested": [
                {
                    "name": "variables",
                    "type": "collection",
                    "label": "Bird Variables",
                    "spec": [
                        "rpc://birdVariables"
                    ]
                }
            ]
        }
    }
]

远程过程 -> 通信

{
    "url": "/bird/get-variables",
    "method": "POST",
    "body": {
        "birdId": "{{parameters.birdId}}"
    },
    "headers": {
        "Authorization": "Apikey {{connection.apikey}}"
    },
    "response": {
        "iterate":{
            "container": "{{body.data}}"
        },
        "output": {
            "name": "{{item.name}}",
            "label": "{{item.label}}",
            "type": "{{item.type}}"
        }
    }
}

提前致谢。

4

2 回答 2

1

刚刚尝试了以下,它的工作。根据Integromat's Docs,您可以使用该wrapper指令,rpc如下所示:

{
    "url": "/bird/get-variables",
    "method": "POST",
    "body": {
        "birdId": "{{parameters.birdId}}"
    },
    "headers": {
        "Authorization": "Apikey {{connection.apikey}}"
    },
    "response": {
        "iterate":"{{body.data}}",
        "output": {
            "name": "{{item.name}}",
            "label": "{{item.label}}",
            "type": "{{item.type}}"
        },
        "wrapper": [{
          "name": "variables",
          "type": "collection",
          "label": "Bird Variables",
          "spec": "{{output}}"
        }]
    }
}

mappable parameters会看起来像:

[
    {
        "name": "birdId",
        "type": "select",
        "label": "Bird Name",
        "required": true,
        "options": {
            "store": "rpc://selectbird",
            "nested": "rpc://birdVariables"
        }
    }
]
于 2021-02-01T19:56:50.993 回答
1

我自己需要这个。拉入具有不同类型但希望它们全部显示以供用户更新自定义字段或在创建联系人时能够更新它们的自定义字段。不确定是否最好让它们全部显示或有一个选择下拉菜单,然后让用户使用地图不止一个。

这是我对自定义字段的 Get 回复。你能展示一下我的代码应该是什么样子吗?像往常一样在输出中添加一个值时有点困惑,您是否需要在 integromat 中使用两个单独的 RPC?注意到您的商店和嵌套是不同的。


    {
    "customFields": [
        {
            "id": "5sCdYXDx5QBau2m2BxXC",
            "name": "Your Experience",
            "fieldKey": "contact.your_experience",
            "dataType": "LARGE_TEXT",
            "position": 0
        },
        {
            "id": "RdrFtK2hIzJLmuwgBtAr",
            "name": "Assisted by",
            "fieldKey": "contact.assisted_by",
            "dataType": "MULTIPLE_OPTIONS",
            "position": 0,
            "picklistOptions": [
                "Tom",
                "Jill",
                "Rick"
            ]
        },
        {
            "id": "uyjmfZwo0PCDJKg2uqrt",
            "name": "Is contacted",
            "fieldKey": "contact.is_contacted",
            "dataType": "CHECKBOX",
            "position": 0,
            "picklistOptions": [
                "I would like to be contacted"
            ]
        }
    ]
}


于 2021-02-16T14:55:17.240 回答