Wednesday
So I am experimenting with bulk uploading to Creatio using a HTTP POST under Custom Action. I take a bunch of records and split them into batches and can succesfully loop through them. Through some editing I am able to get a variable resembling the below that I thought was the correct way of uploading multiple files to Creatio:
{
"records": [
{
"code": "test1",
"name": "test1"
},
{
"code": "test2",
"name": "test2"
}
]
}
I'm having two issues, firstly how do I pass this entire records list into a JSON payload? The only obvious way of passing datapills I have found is by setting up the fields manually but then I can only select one value at a time (e.g. I could define name as a field, but then I can't pass multiple records through this, if that makes sense, at least it not in the current format).
Secondly, I have tried instead just copy and paste the values into a JSON payload just to test if bulk uploading works however I get a lot of JSON errors. The first being that the schema is incorrect so I have also tried:
{
"schema": [
{
"name": "code",
"type": "string",
"optional": false,
"control_type": "text",
"label": "Code"
},
{
"name": "name",
"type": "string",
"optional": false,
"control_type": "text",
"label": "Name"
}
],
"records": [
{
"code": "test1",
"name": "test1"
},
{
"code": "test2",
"name": "test2"
}
]
}
But this gives 'Schema should be an array of objects' and I can't seem to find a layout that works. If anyone knows either how to pass a datapill into a JSON payload in the format I've given or alternatively how a Creatio payload should be laid out this would be much appreciated!
Thursday
Hi @PhilipMasters,
From the JSON payload which you have shared, records element is a List of object type.
You can create a List variable of object type with required fields.
Once the List is created and added with required values. You can directly pass this variable to the records datapill defined in the custom action.
Could you please share the documentation which you are referring to about bulk creation to understand the behavior of the API.
Regards,
Prudvi
Thursday
Hi @PhilipMasters ,
Here are my answer for the following questions.
1. firstly how do I pass this entire records list into a JSON payload?
--> Since an Entire record will have similar structure, we can place the entire JSON payload in either in common data model
or Variable (data type: type list)
My suggestion would go with Common data model which can be re-used.
2. For the second question:
Looks like you combined both Schema and the Input payload hence it may be reason you would have received an error.
Adding screenshots for your reference.
Thanks and Regards,
Shivakumara K A