Hello,
I want to create an XML file with as many collections as I have bundles from the previous module.
If I have 5 bundles, I want the XML file to have 5 collections and so on …
How can this be created? Is there a way to loop & add collections to XML data?
Thanks
David
samliew
September 10, 2023, 10:44am
2
That should be possible. Do you have example data on your inputs and what you wish to output?
2 Likes
This is the XML data for “1 payment”, for each payment I want to add a CdtTrfTxInf to the XML data. I’m trying to create something with the Data Store, but no succes yet
<?xml version="1.0" encoding="UTF-8"?>
<Document
xmlns="urn:iso:std:iso:20022:tech:xsd:pain.001.001.03"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<CstmrCdtTrfInitn>
<GrpHdr>
<MsgId>1234</MsgId>
<CreDtTm>2023-09-10T09:59:15</CreDtTm>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>5253.00</CtrlSum>
<InitgPty>
<Nm>test bv</Nm>
</InitgPty>
</GrpHdr>
<PmtInf>
<PmtInfId>0095331</PmtInfId>
<PmtMtd>TRF</PmtMtd>
<BtchBookg>false</BtchBookg>
<NbOfTxs>1</NbOfTxs>
<CtrlSum>553.00</CtrlSum>
<ReqdExctnDt>2023-09-11</ReqdExctnDt>
<Dbtr>
<Nm>test bv</Nm>
</Dbtr>
<DbtrAcct>
<Id>
<IBAN>BE9773605035XXXX</IBAN>
</Id>
</DbtrAcct>
<DbtrAgt>
<FinInstnId>
<BIC>KREDBEBB</BIC>
</FinInstnId>
</DbtrAgt>
<CdtTrfTxInf>
<PmtId>
<EndToEndId>4955</EndToEndId>
</PmtId>
<Amt>
<InstdAmt Ccy="EUR">553.00</InstdAmt>
</Amt>
<CdtrAgt>
<FinInstnId>
<BIC>ARSPBE22</BIC>
</FinInstnId>
</CdtrAgt>
<Cdtr>
<Nm>CRP080222BBE09</Nm>
<PstlAdr>
<Ctry>BE</Ctry>
</PstlAdr>
</Cdtr>
<CdtrAcct>
<Id>
<IBAN>BE2297339718XXXX</IBAN>
</Id>
</CdtrAcct>
<RmtInf>
<Ustrd>D02/00000057 -/- CRP080222B09 </Ustrd>
</RmtInf>
</CdtTrfTxInf>
</PmtInf>
</CstmrCdtTrfInitn>
</Document>```
Could you please post the content of a sample bundle?
also, there is a module that converts JSON to XML, check this post which has a solution:
Hello,
I finally got it.
So I had to make HTTP Request with Parse response activated.
[image]
Then I had to transform to JSON (thanks for the tip)
[image]
Then the data was ready to convert from JSON to XML
[image]
From here i could finally upload the XML into a file via SFTP
[image]
So before, I was saving a file but not in the JSON format even if it looked to me it was JSON, that’s why I was missing all the steps and getting all sort of errors.
From the HTTP Request I w…
2 Likes
The output comes from a Monday module from which I get some variables I want to use to fill in the XML collections.