What is your goal?
send multiple files in my Custom App
What is the problem & what have you tried?
I’d like to send multiple files to an external API using multipart/form-data in my integration.
I have already configured my mappable parameters to accept an array of files with the following structure:
{
"name": "files",
"type": "array",
"label": "Files",
"required": false,
"spec": {
"type": "collection",
"spec": [
{
"name": "file_name",
"type": "text",
"label": "Name",
"semantic": "file:name"
},
{
"name": "file_data",
"type": "buffer",
"label": "Data",
"semantic": "file:data"
}
]
}
}
and this in my communication section :
{
"url": "https://webhook.site/770dbb14-a0a1-4552-81e0-b9de3bfaa7",
"method": "POST",
"type": "multipart/form-data",
"qs": {
"id": "{{parameters.id}}"
},
"body": {
"TagList": "{{ stringify(parameterToObject(parameters.tagList))}}",
"files": "{{parseFiles(parameters.files)}}"
}
}
with the parseFiles IML function:
function parseFiles(files) {
if (!files) return;
return files.map(file => {
return {
value: file.data,
options: {
filename: file.filename
}
}
})
}
The webhook receives the request, but the files are undefined in the formValues.
Error messages or input/output bundles
get undefined files
If anyone already encountered this problem it would really helped me!