Writing the Generated Content to File

Sometimes one wants to write the generated XML to a file. For that use case we provide a Document to Binary Snap which can take the content and convert it to binary data object, which then can be written to a file, such as using a File Writer Snap.



Above we map XML to the content field of the Document to Binary Snap, and set the Encode or Decode option on the Document to Binary Snap to NONE.

This outputs one binary document for each order. We can then write it to a directory. (Careful, here you’d want to use the APPEND option, since you potentially would be writing two files to the same directory or you can use an expression such as Date.now() to write individual files for each incoming binary data object).

To successfully reuse pipelines:
  1. Download and import the pipeline in to the SnapLogic Platform.
  2. Configure Snap accounts, as applicable.
  3. Provide pipeline parameters, as applicable.