cancel
Showing results for 
Search instead for 
Did you mean: 

XML not getting populated with all Data from Source

kgor
New Contributor

Hi,

I have run into an interesting situation where my XML generator is not populating entire CSV file I reading. Basically, I am reading CSV file and trying to send that as one batch to SAGE Intacct using XML generator. but, in turn the XML generator is sending each line from CSV as separate XML document.

Any help or insight is appreciated

Thank you

6 REPLIES 6

mbowen
Employee
Employee

The XML Formatter snap will collect all of its input and output a single binary document. You could convert the output to a document using the “Binary to Document” snap, maybe with no encoding. You could then use a mapper to extract content and adjust content type, if necessary (ex: “application/xml”).

kgor
New Contributor

Hi,

Thank you, So I did what you suggested, Below are the screenshots for your ref and I still get multiple documents

Mapper

image

XML Formatter

image

Binary to document

image

Error returned by XML formatter

image

I am trying to achieve this , where all my lines should get populated in between tags.

            <create>
                <GLBATCH>
                    <JOURNAL>PYRJ</JOURNAL>
                    <BATCH_DATE>$BatchDate</BATCH_DATE>
                    <BATCH_TITLE>$BatchTitle</BATCH_TITLE>
                    <ENTRIES>
                        <GLENTRY>
                            <ACCOUNTNO>$GLAccount</ACCOUNTNO>
                            <DEPARTMENT>$Dept</DEPARTMENT>
                            <LOCATION>$Location</LOCATION>
                            <PROJECTID>$Project</PROJECTID>
                            <TR_TYPE>-1</TR_TYPE>
                            <AMOUNT>$Credit</AMOUNT>
                            <DESCRIPTION>$Description</DESCRIPTION>
                            <GLDIMEVENT>$Event</GLDIMEVENT>
                            <REFERENCENO>$ReferenceNo</REFERENCENO>
                        </GLENTRY>
                    </ENTRIES>
                </GLBATCH>
            </create>

It looks like the XML Formatter will only collect input documents into one output if a “Root element” is defined, otherwise, it will generate a separate binary document for each input document. So, maybe try that. It is my understanding that you want one XML payload to submit to Sage Intacct API. Thank you for the screen shots BTW.

kgor
New Contributor

Hi ,

Thank you for the reply. So, I gave it a XSD file created from XML file below. but the file generated is incorrect. where The GLENTRY node should get repeated but its not.

image

after I gave it XSD schema and root node here is formatter screenshot

image

not sure how can I send you the XSD don’t see a option to attach the XSD. Here is screenshot of what it generated

image

where as it actually should generate per XML above

Thank you,
Kamlesh