Hi community,
Is it possible two handle two subtables in a request mapping table (temporary table)?
Thanks,
Daniel
Hi community,
Is it possible two handle two subtables in a request mapping table (temporary table)?
Thanks,
Daniel
Yes, but has some caveats depending on your case. Can you give more info about the json shape you are trying to fill and the Nextworld shape you are trying to fill it from?
I just looked through all the shipped Nextworld endpoints and couldn’t find an example where someone needed that kind of mapping. There are test cases for it though. The convoluted test case metadata is unlikely to be useful to you so I won’t confuse things with that.
Hi Kendra,
Here’s a sample payload illustrating the type of request I need. As you can see, it contains multiple list objects, which means the request table must support several subtables within the same structure.
{
"accountId": "123456",
"invoiceHeader": {
"taxes": [
{
"taxName": "SALES_TAX",
"taxRate": 0.111111,
"taxType": "SALES",
"taxAmount": {
"amount": 30,
"currencyCode": "USD"
},
"taxableBasisAmount": {
"amount": 300,
"currencyCode": "USD"
}
},
{
"taxName": "SALES_TAX",
"taxRate": 0.222222,
"taxType": "SALES",
"taxAmount": {
"amount": 20,
"currencyCode": "USD"
},
"taxableBasisAmount": {
"amount": 200,
"currencyCode": "USD"
}
},
{
"taxName": "SALES_TAX",
"taxRate": null,
"taxType": "SALES",
"taxAmount": {
"amount": null,
"currencyCode": null
},
"taxableBasisAmount": {
"amount": null,
"currencyCode": null
}
}
]
},
"invoiceLineItems": [
{
"charges": [
{
"taxes": [
{
"taxName": "SALES_TAX",
"taxRate": 0.111111,
"taxType": "SALES",
"taxAmount": {
"amount": 9.05,
"currencyCode": "USD"
},
"taxableBasisAmount": {
"amount": 95.05,
"currencyCode": "USD"
}
}
]
}
],
"quantity": {
"quantity": 2,
"quantityUnit": "EA"
}
},
{
"charges": [
{
"taxes": [
{
"taxName": "SALES_TAX",
"taxRate": 0.222222,
"taxType": "SALES",
"taxAmount": {
"amount": 20,
"currencyCode": "USD"
},
"taxableBasisAmount": {
"amount": 200,
"currencyCode": "USD"
}
}
]
}
],
"quantity": {
"quantity": 4,
"quantityUnit": "EA"
}
},
{
"charges": [
{
"taxes": [
{
"taxName": "SALES_TAX",
"taxRate": 0.111111,
"taxType": "SALES",
"taxAmount": {
"amount": 20.95,
"currencyCode": "USD"
},
"taxableBasisAmount": {
"amount": 204.95,
"currencyCode": "USD"
}
}
]
}
],
"quantity": {
"quantity": 6,
"quantityUnit": "EA"
}
}
]
}
Simplifying so it’s easier to reason about:
the json paths of invoiceHeader.taxes as one subtable and invoiceLineItems.charges as another - easy. Two sibling lists can be mapped. But your case has my caveat. Where the mapping will struggle is with invoiceLineItems.charges[].taxes[]. For those, it is much more plausible to use the JSON Array and JSON Object constructs in Logic Block builder to create the shapes exactly as you need it. I believe there is good help text/doc on how to use those options for advanced payload body options.