Integromat - 从 rpc 动态渲染集合规范
Integromat - Dynamically render spec of a collection from an rpc
我正在尝试从 RPC 动态呈现 collection
的 spec
(规范)。无法正常工作。这里我附上了 'module->mappable parameters' 和 'remote procedure->communication' 的代码。
模块 -> 可映射参数
[
{
"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,您可以像这样对 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"
}
}
]
我自己也需要这个。拉入具有不同类型但希望它们全部显示给用户以更新海关字段或在创建联系人时能够更新它们的自定义字段。不确定是否最好让它们全部显示或有一个 select 下拉菜单然后让用户使用地图超过一个。
这是我对自定义字段的 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"
]
}
]
}
我正在尝试从 RPC 动态呈现 collection
的 spec
(规范)。无法正常工作。这里我附上了 'module->mappable parameters' 和 'remote procedure->communication' 的代码。
模块 -> 可映射参数
[
{
"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,您可以像这样对 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"
}
}
]
我自己也需要这个。拉入具有不同类型但希望它们全部显示给用户以更新海关字段或在创建联系人时能够更新它们的自定义字段。不确定是否最好让它们全部显示或有一个 select 下拉菜单然后让用户使用地图超过一个。
这是我对自定义字段的 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"
]
}
]
}