If you’ve tried to pull in RPC data into a collection type, you’ll have noticed that it doesn’t work. Instead what you can do is to wrap your RPC return value in a collection.
This is the RPC config. The critical part is the wrapper which nests our output in the required format for a collection instead of returning the output directly.
{
"url": "/forms/{{parameters.formId}}",
"method": "GET",
"response": {
"iterate": "{{body}}",
"output": {
"name": "{{item.id}}",
"label": "{{item.label}}",
"type": "text"
},
"wrapper": {
"type": "collection",
"name": "data",
"spec": "{{output}}"
}
}
}
And then this is the interface:
[
{
"name": "event",
"type": "text",
"label": "Event Name"
},
{
"name": "orgId",
"type": "text",
"label": "Org ID"
},
{
"name": "sentAt",
"type": "timestamp",
"label": "Trigger Sent At"
},
"rpc://getFormFields?formId={{webhook.resourceId}}"
]
I’m sharing this because I wasted hours trying to just pass the list of fields as spec to a collection type which seems to not be supported. Hopefully this helps somebody!