Genpact Cora Knowledge Center

Support

File Writer Activity Overview

V9.3

Overview

Use the File Writer activity to create, edit, and save a file into the Cora SeQuence database as part of a workflow. After you create the file, you can access and use its data in other activities.
You can also use the File Writer activity to generate a PDF file with data from forms.

Use cases

  • Create a spreadsheet of all support tickets with a designated severity level.
  • Create a file from large, unstructured data, and import it to Cora SeQuence.
  • Create a file and use it as an attachment in File Activities.
  • Create PDF files for archiving or printing purposes. 

Configuration properties by file type

You can create three types of files: CSV, OpenXML, or PDF.


For all file types, you need to define the file's access mode:

  • Internal (default): Allows the system to access the file and share it with a different workflow.  
  • Private: Only you can access the file.
  • Public: Anyone can access the file.

Each file type requires different properties.

Main CSV file properties

PropertyDescriptionWizard
EncodingSupported character encoding types:
  • ASCII
  • Big-Endian Unicode
  • Unicode
  • UTF32
  • UTF7
  • UTF8

Click image to enlarge it.
First row contains headerSelect this option, if the first row of the source file contains a header.
In this case, the first row is skipped when the file is processed.
Trim white spacesRemoves unnecessary spaces in cell values.
This option is selected by default.

Main OpenXML file properties

PropertyDescriptionWizard
EncodingSupported character encoding types:
  • ASCII
  • Big-Endian Unicode
  • Unicode
  • UTF32
  • UTF7
  • UTF8

Click image to enlarge it.
Sheet NameIf the source file contains more than one sheet, specify the name of the sheet that you want to process.
First row contains headerSelect this option, if the first row of the source file contains a header.
In this case, the first row is skipped when the file is processed.

Main PDF file properties

PropertyDescriptionWizard
HTML ContentURL: Enter the URL where the content for the PDF file is.
Click image to enlarge it.
HTML: Paste the HTML code from which to create the PDF file.
Credential TypeRequired only for URL sources.
If the URL that you entered requires credentials, set the credential type and name.
Page SizeIf the PDF needs to be printed, select the required paper size.
Enable links in the PDFSelect this option to activate hyperlinks from the source HTML in the PDF file.
Add page numberingSelect this option to display page numbers in the PDF file.  

Best practices for creating PDF files

You can create PDF files for archiving or printing purposes. For example, you can create a PDF that includes all the sign-off forms of a workflow for future auditing procedures.
When you create a PDF file, you can either specify a URL that contains the required HTML content, or write your own HTML using a code editor. 

When you specify a URL, make sure that:

  • All the external resources, such as CSS, JS, and image files, referenced in the HTML can be accessed. 
  • Do not use any Java Script that dynamically changes the HTML DOM as the changes may not be reflected in the generated PDF document.

When designing your own HTML:

  • Take into consideration the target paper size dimensions (width and height) and use the correct units of measurement when placing controls on the page. 
  • If the PDF file does not need to be printed, select a larger paper size for complex forms. For example, select A3 instead of A4.
  • Use a simple page layout.
  • Reduce image size and avoid embedded objects and Java Script.
  • Design the HTML code to fit a PDF output, and not as a regular HTML page.

Configure the File Writer activity

  1. Add the File Writer activity to your workflow.
    1. In the Properties screen, enter a name for the activity, and then click Next.
  2. Define the file type.
    1. In the Definition screen, enter a name for the file that you want to create, including file extension.
    2. Select a file type: CSV, OpenXML, or PDF.

IMPORTANT
After you select a file type and click Next, you cannot change the file type. To change the file type, cancel the activity wizard and start a new activity wizard.

  1. Define the file properties.
    For details, see the Configuration properties by file type section above.
  2. Do one of the following:
    • If you are creating a PDF file, click Finish.
    • If you are creating CSV and OpenXML files, you need to map the fields in the file with values from a source file.
      For more details, see the Define field properties section below.
      Click Next.

Define field properties

When configuring CSV and OpenXML files, you need to map the fields in the file with values retrieved from the source file.
You can set up advanced formatting properties for Date, Time, and DateTime values.

  1. In the File Field Properties screen, set the source file used to create the CSV or OpenXML file.
  2. Define the field properties:
    1. Under Name, define the name of the property in the target file.
    2. Under Value, click the ellipsis button to define the relevant value in the Expression Wizard.
    3. For each field, select a relevant type.
  3. If additional fields are required, click Add Field.
  4. (Optional) For date, dateTime, time, and Boolean fields, you can define additional options.
    Click Advanced Options, and select the required format:
Date, Time, DateTimeBoolean
  • Use default settings: the format defined for your system.
  • Use standard format: select one of the available standards.
  • Define custom format: set up your own format. 
  • Use default options: the format defined for your system.
  • Define custom values: enter the values to use instead of true and false.


NOTE
To make sure that the output files can be easily shared, starting with V9.2, new files created with the File Writer activity are set to public access mode by default.

Access and use the file's data

After you create the file, you can access its data through the File Writer activity's metadata.
For example, if you want to use data from the created file in a Put File activity, you can set the created file as the file source.


V9.2

Overview

Use the File Writer activity to create, edit, and save a file into the Cora SeQuence database as part of a workflow. After you create the file, you can access and use its data in other activities.
You can also use the File Writer activity to generate a PDF file with data from forms.

Use cases

  • Create a spreadsheet of all support tickets with a designated severity level.
  • Create a file from large, unstructured data, and import it to Cora SeQuence.
  • Create a file and use it as an attachment in File Activities.
  • Create PDF files for archiving or printing purposes. 

Configuration properties by file type

You can create three types of files: CSV, OpenXML, or PDF. Each file type requires different properties.

Main CSV file properties

PropertyDescriptionWizard
EncodingSupported character encoding types:
  • ASCII
  • Big-Endian Unicode
  • Unicode
  • UTF32
  • UTF7
  • UTF8

Click image to enlarge it.
First row contains headerSelect this option, if the first row of the source file contains a header.
In this case, the first row is skipped when the file is processed.
Trim white spacesRemoves unnecessary spaces in cell values.
This option is selected by default.

Main OpenXML file properties

PropertyDescriptionWizard
EncodingSupported character encoding types:
  • ASCII
  • Big-Endian Unicode
  • Unicode
  • UTF32
  • UTF7
  • UTF8

Click image to enlarge it.
Sheet NameIf the source file contains more than one sheet, specify the name of the sheet that you want to process.
First row contains headerSelect this option, if the first row of the source file contains a header.
In this case, the first row is skipped when the file is processed.

Main PDF file properties

PropertyDescriptionWizard
HTML ContentURL: Enter the URL where the content for the PDF file is.
Click image to enlarge it.
HTML: Paste the HTML code from which to create the PDF file.
Credential TypeRequired only for URL sources.
If the URL that you entered requires credentials, set the credential type and name.
Page SizeIf the PDF needs to be printed, select the required paper size.
Enable links in the PDFSelect this option to activate hyperlinks from the source HTML in the PDF file.
Add page numberingSelect this option to display page numbers in the PDF file.  

Best practices for creating PDF files

You can create PDF files for archiving or printing purposes. For example, you can create a PDF that includes all the sign-off forms of a workflow for future auditing procedures.
When you create a PDF file, you can either specify a URL that contains the required HTML content, or write your own HTML using a code editor. 

When you specify a URL, make sure that:

  • All the external resources, such as CSS, JS, and image files, referenced in the HTML can be accessed. 
  • Do not use any Java Script that dynamically changes the HTML DOM as the changes may not be reflected in the generated PDF document.

When designing your own HTML:

  • Take into consideration the target paper size dimensions (width and height) and use the correct units of measurement when placing controls on the page. 
  • If the PDF file does not need to be printed, select a larger paper size for complex forms. For example, select A3 instead of A4.
  • Use a simple page layout.
  • Reduce image size and avoid embedded objects and Java Script.
  • Design the HTML code to fit a PDF output, and not as a regular HTML page.

Configure the File Writer activity

  1. Add the File Writer activity to your workflow.
    1. In the Properties screen, enter a name for the activity, and then click Next.
  2. Define the file type.
    1. In the Definition screen, enter a name for the file that you want to create, including file extension.
    2. Select a file type: CSV, OpenXML, or PDF.

IMPORTANT
After you select a file type and click Next, you cannot change the file type. To change the file type, cancel the activity wizard and start a new activity wizard.

  1. Define the file properties.
    For details, see the Configuration properties by file type section above.
  2. Do one of the following:
    • If you are creating a PDF file, click Finish.
    • If you are creating CSV and OpenXML files, you need to map the fields in the file with values from a source file.
      For more details, see the Define field properties section below.
      Click Next.

Define field properties

When configuring CSV and OpenXML files, you need to map the fields in the file with values retrieved from the source file.
You can set up advanced formatting properties for Date, Time, and DateTime values.

  1. In the File Field Properties screen, set the source file used to create the CSV or OpenXML file.
  2. Define the field properties:
    1. Under Name, define the name of the property in the target file.
    2. Under Value, click the ellipsis button to define the relevant value in the Expression Wizard.
    3. For each field, select a relevant type.
  3. If additional fields are required, click Add Field.
  4. (Optional) For date, dateTime, time, and Boolean fields, you can define additional options.
    Click Advanced Options, and select the required format:
Date, Time, DateTimeBoolean
  • Use default settings: the format defined for your system.
  • Use standard format: select one of the available standards.
  • Define custom format: set up your own format. 
  • Use default options: the format defined for your system.
  • Define custom values: enter the values to use instead of true and false.


NOTE
To make sure that the output files can be easily shared, starting with V9.2, new files created with the File Writer activity are set to public access mode by default.

Access and use the file's data

After you create the file, you can access its data through the File Writer activity's metadata.
For example, if you want to use data from the created file in a Put File activity, you can set the created file as the file source.



V9.1 and earlier

Context

Use the File Writer Activity to create a file, write (edit) to the file, and save the file to the Cora SeQuence database as part of a workflow. After you create the file, you can access and use the file's data in other activities. 

Use Cases

  • Create a spreadsheet of all support tickets with a designated severity level.
  • Create a file from large, unstructured data that you import to .
  • Create a file and use it as an attachment in File Activities.
  • File enrichment.

Define the File

  • Type a file name including the file extension.
  • Select a file type: CSV or OpenXML

IMPORTANT: After you select a file type and click Next, you cannot change the file type (even if you click back). If you need to change the file type, cancel the activity wizard and start a new activity wizard. See the screenshot below.

CSV Files

CSV Files Configuration Parameters

ParameterDescription
Encoding
  • ASCII
  • Big-Endian Unicode
  • Unicode
  • UTF32
  • UTF7
  • UTF8
First row contains headerSelect if the first row of the source file contains a header. This row is skipped when the file is processed.
Has fields enclosed in quotesFields contain quotations when they are used to count separator symbols as part of the field value.
For example, if a field value is 52,345 and comma is a defined separator, the entire field is wrapped in quotations "52,345".
Cases in which a field is wrapped in quotations for other reasons, and the Has fields enclosed in quotes checkbox is selected, the quotations are removed from the field.
Trim white spacesRemoves unnecessary spaces in cell values. This option is selected by default.


OpenXML Files

OpenXML Files Configuration Parameters

ParameterDescription
Encoding
  • ASCII
  • Big-Endian Unicode
  • Unicode
  • UTF32
  • UTF7
  • UTF8
Sheet NameIf the file contains more than one sheet, specify the sheet name that you want to process. If this field is empty, the first sheet in the file is selected.
First row contains headerSelect if the first row of the source file contains a header. This row is skipped when the file is processed.


Define Field Properties - All File Types

This window depends on previous configurations. In this example, we selected a CSV file with fixed width.

File Field Properties Configuration Parameters

ParameterDescription
Source QueryThe source of the data that you want to include in the file.
NameField name that you enter.
ValueField value.
Field TypeDetermines the valid values for the property.
Advanced OptionsSee the Advanced Options section.


Define Advanced Options - All Files (optional)

DateTime Configuration


Time Configuration

Access and Use the File's Data

After you create the file, you can access the file's data from the activity's metadata. For example, if you want to use data from the created file in a Put File Activity, you can use the created file when defining the file source.