首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Integromat - rpc集合的动态呈现规范

Integromat - rpc集合的动态呈现规范
EN

Stack Overflow用户
提问于 2021-01-31 18:45:41
回答 2查看 557关注 0票数 2

我正在尝试动态地呈现来自RPC的spec ( collection规范)。不能让它起作用。这里我附加了‘模块->可映射参数’和‘远程过程->通信’的代码。

模块->可映射参数

代码语言:javascript
复制
[
    {
        "name": "birdId",
        "type": "select",
        "label": "Bird Name",
        "required": true,
        "options": {
            "store": "rpc://selectbird",
            "nested": [
                {
                    "name": "variables",
                    "type": "collection",
                    "label": "Bird Variables",
                    "spec": [
                        "rpc://birdVariables"
                    ]
                }
            ]
        }
    }
]

远程过程->通信

代码语言:javascript
复制
{
    "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}}"
        }
    }
}

提前谢谢。

EN

回答 2

Stack Overflow用户

回答已采纳

发布于 2021-02-01 19:56:50

刚刚试过了然后就成功了。根据Integromat博士,可以为rpc使用wrapper指令,如下所示:

代码语言:javascript
复制
{
    "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就会看起来像:

代码语言:javascript
复制
[
    {
        "name": "birdId",
        "type": "select",
        "label": "Bird Name",
        "required": true,
        "options": {
            "store": "rpc://selectbird",
            "nested": "rpc://birdVariables"
        }
    }
]
票数 2
EN

Stack Overflow用户

发布于 2021-02-16 14:55:17

我自己需要这个。导入具有不同类型但希望它们全部显示的自定义字段,以便用户更新海关字段或在创建联系人时能够更新这些字段。不确定是否最好让它们全部显示,或者有一个select下拉列表,然后让用户使用多个映射。

以下是来自Get自定义字段的响应。你能告诉我我的代码应该怎么看吗。很少感到困惑,因为通常需要在输出中添加一个值,您是否需要两个单独的RPC在整数中?注意到你的商店和嵌套是不同的。

代码语言:javascript
复制
    {
    "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"
            ]
        }
    ]
}
票数 1
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/65982942

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档