json - Integromat - 从 rpc 动态渲染集合的规范

标签 json automation make.com integromat-apps

我正在尝试从 RPC 动态渲染 collectionspec(规范)。无法让它发挥作用。这里我附上了“模块->可映射参数”和“远程过程->通信”的代码。

模块 -> 可映射参数

[
    {
        "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}}"
        }
    }
}

提前致谢。

最佳答案

刚刚尝试了以下方法并且成功了。根据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}}"
        }]
    }
}

您的可映射参数将如下所示:

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

关于json - Integromat - 从 rpc 动态渲染集合的规范,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/65982942/

相关文章:

make.com - 通过 intergromat 应用程序创建 RPC 返回 404

javascript - 为什么多个 $.getJSON 调用不能正常工作?

java - 在 Robotium Script 中用预期结果验证多个单词

c# - 测试工具与测试框架有何不同/

perl - 使用 perl 连接到远程 tty

make.com - 更改 Integromat 模块 ID

javascript - Echart bar不会显示使用json

sql - 将 json 数组的每个项目的值与 postgres 9.6 相乘

java - 名称为 '@attr' 的 Json 转为 java POJO

node.js - 在 Azure Bot Framework (Nodejs) 中使用 session.send 向对话发送 Webhook 响应