Data Action Input Format

Hello,
I am trying to use Genesys Cloud data actions to call an external API but it seems like dynamic arrays are not supported. Below is an example of the input that is needed. The ClassActivityDetails is a dynamic list that may have a different length every time it is called. Is it possible to account for this within Genesys, either within the data action itself or architect? Or would we need to use 3rd party tool to update the array before calling the API?

Request:
{
"InteractionRecords": {
"InteractionRecordsRequest": {
"ContractAccountNumber": "",
"BusinessPartner": "",
"ClassActivityDetails": [
{
"ContactClass": "",
"ContactAction": ""
},
{
"ContactClass": "",
"ContactAction": ""
}
]
}
}
}

There are at least a couple of possibilities that come to mind. First question is, is there a reasonable limit to the number of items in the class activity details? If so, you could have class1, class2, class3, and action1, action2, action3 etc inputs for however many values could be there. From there, you can use the velocity #if to add detail objects based on if the class and/or action input is set.

Here is another option that might be easier, creating the classActivityDetails object in architect.
In architect, create the ClassActivityDetails array using the json data type tools.
Use the JsonStringify function in architect to turn the object into a json escaped string.
Pass that value into your data action as a string.
Use the json decode velocity macro to convert it back from a string into a json array.

--Jason