Information for: DEVELOPERS   PARTNERS

File: Write adaptor

The File write adaptor allows you to store information about a subscriber journey as a file object in your cloud provider’s storage service, enabling you to keep persistent information about a journey for use in other graphs.

Important

The file write adaptor overwrites existing content. Acquia recommends you use a unique filename when using the file write adaptor to prevent unintentional data loss.

Note

Acquia Journey supports the Amazon Web Services Simple Storage System (AWS S3), an object-based storage scheme presenting a file-system view of the objects it stores. Folders are buckets, and files are objects. Reading and writing data from S3 buckets is useful for integrating with other systems handling file-based integrations such as DMPs.

Creating the adaptor

To use the file write adaptor, complete the following steps:

  1. Sign in to your Acquia Journey admin interface.
  2. Create an adaptor of the type File.
  3. In the configuration panel, configure the following settings for the adaptor:
    • Under Adaptor Action, click the select box, and select Write.
    • Under File Name, click the Data Schema panel. Identify the schema location mapping to the file name, click its name, and then click the left arrow icon. The file name must include any necessary path component.
    • Under File Contents To Write, click the select box. In the Data Schema panel, identify the schema location containing the content of the file to upload to your cloud provider, click its name, and then click the left arrow icon.
  4. Acquia Journey saves each configuration change as you complete it. To close the adaptor configuration page, click the X next to the title of the file adaptor in the tab bar.

Generating a unique filename

To create a unique file name to save to your data schema for use with the file write adaptor, Acquia recommends the following approach using a JavaScript node within your graph:

  1. Sign in to your Acquia Journey admin interface.

  2. Find the project you want to change, and click the Project Editor icon.

  3. In the upper-left of the page, click the Action menu, and then click Create new.

  4. Enter a Name for the JavaScript node.

  5. In the Logic section, click JavaScript.

  6. At the bottom of the page, click Create New Item. Acquia Journey will display the JavaScript editor.

  7. Click Add Argument, and then enter basename. Repeat for ext and prefix.

  8. In the JavaScript Editor, enter the following code:

    const uuid = require('uuid/v4');
    const date = new Date();
    
    return prefix + '/' + basename + '_' + date.getTime() + '_' + uuid() + '.' + ext;
    
  9. In the upper-right corner of the editor, click Save Script.

When using the JavaScript node created within your graph, it will save a unique file name to the schema location assigned to Script Return Value. You can assign the schema location as the source for the file write adaptor File Name parameter.

Validation warnings

Invalid Warning Note
Adaptor(s) do not have connection set Adaptor does not have connection configured Create a connection, and choose it from the Adaptor Connection list
Adaptor's configuration requires a data source to be set Missing data contents No source for the file write (file contents to write) is specified
File adaptors need a file name Missing file name No file name provided for file to write