Using Create File Actions

The Create File action in OneTrust Integrations is an effective way to automatically generate a file for business reporting needs. In addition to the standard features in the Reports module, this action goes further by creating custom reports using data from resources and assets across the OneTrust application.

The action is most commonly triggered by a webhook or an internal action, such as completing an assessment or advancing a DSAR workflow. Additionally, it can be referenced through parsing or other logic sequences to create files through each iteration of a workflow.

Things to Know

  • The Create File action not only generates a file but will also store it in our blob storage. If you need to re-upload the generated file for use in the OneTrust platform, we recommend using the FILEID as a reference variable. Using the Upload File action would be redundant as the file is already uploaded to our blob storage. This will permit you to ingest the file into other OneTrust services, such as Targeted Data Discovery.

To create the action

  1. On the Integrations menu, select Integrations.

    The Integrations screen appears.

  2. Create a new workflow or select an existing one.

    The Integration Builder screen appears.

  3. Click the Add Action button.

    The Add Action section appears.

  4. Click the Logic tab, then select Create File.


  5. Complete the fields, then click the Done button to close the action configuration.
    Note:

    Freemarker can be used wherever the Value selector icon is shown, which helps users select values from prior actions.



    Field
    Description
    File Name

    Enter a name for the created file.

    File Format

    Select from the available file formats:

    • CSV (populates the fields below)

    • TXT (requires body)

    • JSON (requires body)

    Delimiter

    Enter a delimiter character to separate values such as commas or slash.

    Does this file contain a header row?

    Select Yes or No.

    Column Header Name

    Enter a name for each column header, if you answered yes to the above field. You can choose a different delimiter for each column.

    Value

    Enter the appropriate value.

    • The first value will be used to specify the size or how many rows are in this file. This option happens by default if you do not select a list object.

    • Values can be either lists or plain text. If the first value is plain text, then you have to select a list object from the dropdown in the Select List Object field.

    CODE
    #Example with index as 'n'
    
    ${(step.dataTransformator_0.list[n].val1)!}
    Enclosing Character

    A column delimiter can be optionally used for each column. This encloses the column value with the supplied character, although, it is per column so you can only enclose certain columns. It is most useful when your column data could contain your chosen delimiter.

    For example, you can use double quotations to enclose a comma in the value of a given column.

    CODE
    #Example with column delimiter enclosing characters 
    
    Col1,Col2,Col3
    123,56.45,"this is a, description"
    Note:

    This option is currently available as a preview feature.

    Select List Object

    If you do not want the first value to specify the number of rows, select a list object from the dropdown. The system will use this field to loop as it create a row for each iteration.

    If this field is left blank, the first column will be referenced to select the list object used to create the file and determine its size.

    If the first Value is plain text, select a list object. If the first Value is a list, you can leave Select List Object blank and the first column will be used to determine the number of rows.

  6. Click the Save button. You can now continue with this workflow configuration to accommodate your business needs. This might include adding actions to send the create file to a given location (e.g. SFTP server) for reporting use cases.

Using Variables Across the Platform

When using the Create File action, you can leverage the response variables in other integration calls.

Variable

Description

fileName

Identifies the naming convention of the created file.

absoluteFilePath

Complete address of a file or directory starting at the root directory of the system.

fileLength

Shows the file length in bytes.

lastModifiedDate

Shows when the file was last updated. This will be null for newly created files.

reference

The random GUID associated with the file.

extension

Shows the type of file (e.g. csv for column, pdf for reports)

dataFields

Always defaults to null.

jobId

The random generated job ID of the executed call.

file

Combines the file GUID, file length, file extension, and file name in a single string.

For example, the reference variable provided in the response can be used as the FILEID to use for other calls instead of having to name the file itself. This is helpful to share the created file to a Results Summary or ingest it as part of platform-wide integrations.

Below is the response of a Create File action:

JSON
{
    "fileName": "order.orderStatus12031651.txt.CSV",
    "absoluteFilePath": null,
    "fileLength": 135,
    "lastModifedDate": null,
    "reference": "2daf9a74-a74e-4851-b338-0e7b2974443c",
    "extension": "CSV",
    "dataFields": null,
    "jobId": null,
    "file": "2daf9a74-a74e-4851-b338-0e7b2974443c:135:CSV:order.orderStatus12031651.txt.CSV"
}