我正在尝试动态地呈现来自RPC的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}}"
}
}
}提前谢谢。
发布于 2021-02-01 19:56:50
刚刚试过了然后就成功了。根据Integromat博士,可以为rpc使用wrapper指令,如下所示:
{
"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-16 14:55:17
我自己需要这个。导入具有不同类型但希望它们全部显示的自定义字段,以便用户更新海关字段或在创建联系人时能够更新这些字段。不确定是否最好让它们全部显示,或者有一个select下拉列表,然后让用户使用多个映射。
以下是来自Get自定义字段的响应。你能告诉我我的代码应该怎么看吗。很少感到困惑,因为通常需要在输出中添加一个值,您是否需要两个单独的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"
]
}
]
}https://stackoverflow.com/questions/65982942
复制相似问题