Closed fuzunspm closed 4 years ago
You need to change the temp object to:
const tempObj = {
TYPE: 0,
MASTER_CODE: item.productCode,
QUANTITY: item.receivedQuantity,
UNIT_CODE: item.unit.label,
DETAILS: `${item.requestId}: ${req.body.description}`
}
and instead insert the TRANSACTION
key to the top level object:
obj.TRANSACTIONS = {
TRANSACTION: temps
}
If the object value is an array, xmlbuilder
creates an element for each item of the array. The name of each element will be the object key associated with the array. More info here: https://github.com/oozcitak/xmlbuilder-js/wiki/Conversion-From-Object#arrays
Thank you very much!
I'm trying to add multiple keys in a single key.
Example:
..and I'm inserting with this code:
But this outputs like this: