HomeGuidesRecipesAPI
HomeGuidesAPILog In
Guides
These docs are for v11.0. Click to read the latest docs for v31.

It is possible to use a CSV file, accessible to the Infiniti application instance, as a source of data for use within an Infiniti project.

Key Concepts

CSV (Comma-Separated Variable) is a plain-text data format consisting of rows of data separated by newlines. Each row may contain one or more "columns" of data separated by a delimiter. The comma (ASCII 44, ,) is conventionally used as a delimiter but another character may be used if the data fields are anticipated to contain commas.

1. Creating a CSV file

A CSV file can be created with any plain-text editor (such as Microsoft Notepad). A simple example file is shown below, consisting of three data columns (id, name, and registration date) and four rows of data. The initial row (the "header row") is optional and can be used to specify the data column names within the file - otherwise they must be specified in the Data Source connection string.

One or more non-data rows may proceed or follow the data (e.g. to specify the date the file was generated, or mark the end of the file explicitly).

id,name,registration date
1,Bob Smith,2007-05-04
2,Jane Fletcher,2009-02-17
3,Angela Baxter,2012-04-17
4,Michael Cooper,2013-01-21

2. Creating a CSV Data Source in Infiniti Manage

Navigate to Infiniti Manage and click on Data Sources on the left-hand menu.

  1. Click "New Data Source"
  2. Select the Connection Type as "CSV"
  3. Define a connection string according to the parameters below
  4. Click the "Test Connection" button to confirm that Infiniti is able to establish a connection with the specified CSV file
  5. Click "Save"

CSV Connection String Parameters

The CSV Data Source requires a connection string, which may consist of the following parameters:

FieldDescriptionRequired
csvThe path to the CSV file (on the Infiniti application server)Yes
hdrA "0" or "1" indicating whether the fields names can be retrieved from the first row of the CSV file.No
fieldsNames of the fields in the order they appear in the text file, comma delimited.When the field names can't be retrieved from the CSV file itself.
widthsColumn-widths if the text file is a fixed width format. Use -1 for a variable width last column.No
delimiterThe delimiter to use, if different from the default (comma).No
skipheaderrowsIf the text file contains non-data header rows that need to be skipped. State the number of rows to ignore from the top of the CSV file.No
skipfooterrowsIf the text file contains non-data footer rows that need to be skipped.
State the number of rows to ignore from the bottom of the CSV file.
No
ignorequotesA "1" will indicate that quotes in the file are not escape characters for text containing delimiters but part of the actual text themselves eg:

GROUP|PS00255|"Find a Flat" Service
No

A sample connection string for the above users.csv might look like:

csv=c:\temp\users.csv;hdr=1

👍

Good Practice

It is recommended to enable "Allow Connection Export" as it will include the connection string in exported projects which use it, allowing the connection to be exported to a different environment.

3. Creating a CSV Data Object in Infiniti Manage

After saving the CSV Data Source in Manage, click on the "Data Objects" button. This will give a list of defined Data Objects for the Data Source. By default a newly-created Data Source has no Data Objects.

  1. Click on "New Data Object" and provide:
    1. Object Type: "File"
    2. Data Object Name / Definition: Users
    3. Display Name: Users
  2. Add all filter fields using the "Add All >>" button, or select filter fields as appropriate using the "Add >>" button
  3. Click the "Save" button

Implementing a CSV file as a data source

  1. Create a CSV file on an Excel spreadsheet.
720
  1. Navigate to Infiniti Manage and click New Data Source.
657
  1. Enter Data Source Name.
  2. Select Connection Type as CSV.
  3. Upload the CSV file that you just created.
  4. Tick Export Connection Attributes and Export Default Data.
  5. Click the Test Connection button to confirm that Infiniti can establish a connection with the specified CSV file. Click Save if successful.
676
  1. Click on the Data Objects button. This will give a list of defined Data Objects for the Data Source. By default, a newly created Data Source has no Data Objects.
  2. Click on New Data Objects.
  3. Set object type as File.
  4. Enter Data Object Name/Definition and Display Name then click Save.
  5. Click on Add All then Save.
703
  1. Go to Design and create a new project.
  2. Add Data Source onto the page.
  3. In the Data Source dropdown list, select the Data Source you created – in this instance, Company Resources.
  4. Select your username as the Table/View.
  5. Tick the Add Answers box and OK.
737

As you can see; your data from the CSV file has been merged to your Infiniti design environment.
To format your data into the generated form, follow these steps:

  1. Go to Properties from the right hand side menu.
  2. Select Data Grid for Appearance, Product ID for Unique Field, and Default Value as Default Type.
780
  1. Save and publish your form to Produce.
  2. Your form can be viewed as the following.
782