Hi folks,
Ok the title is a bit simplistic, but I’m so close to solving something and I just can’t seem to get the final piece done.
I’m encountering an issue while trying to build a JSON payload in the Create JSON
module. Despite correctly formatting the data in a previous module, the value
for one of my keys (SalesEntryLines
) is being transformed into [Collection], [Collection]
instead of the expected JSON array.
This is the structure I’m aiming for:
{
"fields": [
{
"key": "Customer",
"value": "2d53c052-b48c-4101-be88-dabfb1adbe4c"
},
{
"key": "Journal",
"value": "40"
},
{
"key": "Currency",
"value": "USD"
},
{
"key": "Rate",
"value": 1.5
},
{
"key": "SalesEntryLines",
"value": [
{
"Asset": "0c3236d2-65dc-41c3-a9ce-dfb1b62487dc",
"Notes": "167285 Still RX-60-25",
"VATCode": "6",
"AmountFC": 12500,
"Quantity": 1,
"AssetDescription": "167285 Still RX-60-25"
},
{
"Asset": "0c3236d2-65dc-41c3-a9ce-dfb1b62487dc",
"Notes": "168550 Toyota SWE-120",
"VATCode": "6",
"AmountFC": 15000,
"Quantity": 1,
"AssetDescription": "168550 Toyota SWE-120"
}
]
}
]
}
But what I keep getting is this:
{
"fields": [
{
"key": "Customer",
"value": "2d53c052-b48c-4101-be88-dabfb1adbe4c"
},
{
"key": "Journal",
"value": "40"
},
{
"key": "Currency",
"value": "USD"
},
{
"key": "Rate",
"value": "1.5"
},
{
"key": "SalesEntryLines",
"value": "[Collection], [Collection]"
}
]
}
These are the modules:
Output from the Array Aggregator:
Configuration of the Set Variable module:
Output from the Set Variable module:
Configuration of the Create JSON module:
I’ve tried a ton of different stuff to get the Create JSON module to just take the flat input as JSON, but I keep running into a wall and am about to pull my hair out. Can anyone advise?