Writes xml to txt file

Use this step to convert XML data to TXT format

Last published at: February 20th, 2024

XMLToTxt Step

Description:

This step converts and displays the XML data to TXT format, with rows and columns. This step is used in conjunction with ExecuteSQLStatement step as it requires //Row tag in the XML to process. 

Inputs

  • xmlVariable – Variable that holds the xml. Ex: - variable.data
  • txtFilePath – TXT file path on the FlowWright server
  • writeColHeadings - Write column names
  • rowDelimiter – Row delimiter
  • colDelimiter – Column delimiter


Returns

  • True – step executed successfully
  • False – step failed to execute 


Usage: 



Example: 

Let’s build and execute the XmlToTxtDef example.          

  • Create a new definition called “XmlToTxtDef
  • Select the definition and click the “design” button
  • Drag the ExecuteSQL and XMLtoTXT steps and connect as shown above
  • Let’s define variables called “xmlData” to hold the XML value (containing //Row tag) 
  • Click on the “executeSQL” step to configure its properties as shown below
  • Click on the “XmlToTxt” step to configure its properties as shown below. The TXT file path refers to the file location on the server. 
  • Save the process definition, create a new process instance and execute. The step should transform the XML data to TXT file to the path specified on the server. 
  • A sample xmlData (containing //Row tags) are shown here
<SQLData>
  <Row>
    <DEUSERID>8f86ba16-c285-4326-a73b-00e0649f82c7</DEUSERID>
    <DEEXTERNALUSERFULLNAME>Re-assigning</DEEXTERNALUSERFULLNAME>
    <RowID>0</RowID>
  </Row>
  <Row>
    <DEUSERID>8f86ba16-c285-4326-a73b-00e0649f82c9</DEUSERID>
    <DEEXTERNALUSERFULLNAME>Test</DEEXTERNALUSERFULLNAME>
    <RowID>1</RowID>
  </Row>
  <Row>
    <DEUSERID>5c699c6e-a382-4dea-b6ed-02584e7ab961</DEUSERID>
    <DEEXTERNALUSERFULLNAME>DMilan</DEEXTERNALUSERFULLNAME>
    <RowID>4</RowID>
  </Row>
  <Row>
    <DEUSERID>5c699c6e-a382-4dea-b6ed-02584e7ab976</DEUSERID>
    <DEEXTERNALUSERFULLNAME>mila</DEEXTERNALUSERFULLNAME>
    <RowID>5</RowID>
  </Row>
</SQLData>
  • A sample XMLtoTXT transform is shown here
DEUSERID|DEEXTERNALUSERFULLNAME|RowID~8f86ba16-c285-4326-a73b-00e0649f82c7|Re-assigning|0~8f86ba16-c285-4326-a73b-00e0649f82c9|1~5c699c6e-a382-4dea-b6ed-02584e7ab961|DMilan|2~5c699c6e-a382-4dea-b6ed-02584e7ab976|mila|3~f2327f71-6c22-44cb-b719-05a96c8f0463|9~