Creating a CSV Export

Creating a CSV Export

Developing the export definition uses XSLT 1.0 as a processor to generate the text out.

As you are developing, we encourage you to frequently preview the result to understand how your code is working. The source of the preview data is displayed in the "Data Source" panel, as described in Step 6. This data source is populated with the most recent updated 25 records that you also have access to.

We have included a custom function that you can use to help with data formatting. Certain formats such as CSV and JSON require some characters to be handled differently. This can include quotes and commas. The function is called str:sanitize(), and an example of using it is:

<xsl:value-of select="str:sanitize('e123456789')"/>

CSV Exports require a "Header" section for the data to be sorted in the correct column.

For example:


Info
&#10; is the HTML entity for a line break. This is required to let the export module know where the header ends.
The following is the data associated with each column header. The example uses a variety of techniques to get the correct value.  <xsl:for-each select="person"> loops through every person in the data set and retrieves their first name, last name, proprietary ID, and grade. To begin, an opening statement of: is required. This informs the export module that the data portion is beginning.


To call a variable it is required to prepend "$" to the variable name; i.e.: <xsl:value-of select="$fName"/>. starts the next column of the CSV Export.
To end the CSV Export the following is required: .
Idea

Additional Resources

XSLT Data Conversion Transform XML to CSV and JSON: https://piembsystech.com/xslt-data-conversion-transform-xml-to-csv-and-json/
XSLT: Creating New XML/CSV Structure for Transformed Data: https://www.trycatchdebug.net/news/1389321/xslt-transformation-for-xml-csv-structures

    • Related Articles

    • Creating a JSON Export

      Developing the export definition uses XSLT 1.0 as a processor to generate the text out. As you are developing, we encourage you to frequently preview the result to understand how your code is working. The source of the preview data is displayed in ...
    • Creating an XML Export

      Building using a Preset (XML Only) If you do no have specific format requirements, or would like to see examples of how to develop using XSLT 1.0, you can use our "Presets" feature. To use a Preset, click on the button in the Action Bar. Using the ...
    • Export Module - Generating Presets Definitions

      Currently, the ability to generate presets is available only for XML Format exports, with plans to expand support for CSV and JSON formats in the future. Presets are designed to streamline the export process by allowing users to configure settings ...
    • Data Export Module - Resources List

      To help you get started and make the most of the Export Module, we offer a comprehensive set of resources. These articles cover everything from basic setup to advanced usage, ensuring that users of all experience levels can benefit from the module's ...
    • Export Audit Log

      Each Export operation includes a built-in Audit Log that provides a detailed record of individual runs or executions of the Export process. The Audit Log helps ensure traceability and accountability for each time an Export is triggered or executed. ...