Use Case

You have data in a flat file format (csv or similar) which you want to import into Bazefield. The data could be outputs from other software programs, from equipment that isn't networked to a Bazefield Buffer, data from spreadsheets, etc.


Background

The Bazefield Integration Service can be used to parse data from flat files uploaded to the Bazefield Portal. This is a simpler way to manage occasional flat file uploads.

Other options, such as setting up FTP access from your system to the Bazefield master server, may be better suited for frequent, automated data imports.


Steps


Step 1: Write the simple file integration configuration for the structure of your flat file

You will need to write a short configuration that instructs the Bazefield Integration Service on how to parse the flat file. Please reference the BF-01-UM-018 User Manual Bazefield 8 Integration Service Configuration manual for additional detail. The documentation file can be downloaded from the Super User section of your installation's Bazefield Help section:



The configuration you will need to write is an XML file. The parent element that contains all the configuration is <FileConfig> </FileConfig>. Underneath this parent element, you will need to define at least the following key elements (see the in-product documentation for additional options):

XML ElementContentsExample
NameName of the file integration<Name>MyFileIntegration</Name>
PathLeave Empty For NowLeave Empty For Now
FileTypeSpecify the filtering of filenames. Asterisk is a wildcard character.<FileType>MyDataFile.csv</FileType>
SeparatorColumn delimitation character<Separator>Comma</Separator>
RecursiveSet to true when uploading via the Bazefield Portal<Recursive>true</Recursive>
MaxNumberOfLinesExpected maximum number of lines to process<MaxNumberOfLines>200</MaxNumberOfLines>


Next, add a TimeField parent element <TimeField> </TimeField> that contains the information about your timestamps. All of your TimeField elements are then contained within a <TimeFields> </TimeFields> parent element. As a minimum, you will need to define at least the following key elements:

XML ElementContentsExample
TypeType of timestamp<Type>DATETIME</Type>
ColumnColumn in the flat file containing the timestamp (0 indexed)<Column>0</Column
RowThe first row in the flat file containing the timestamp (0 indexed)<Row>3</Row>
FormatTimestamp format, using the .NET Custom Date and Time Format Strings.
<Format>yyyy-MM-dd HH:mm</Format>


Next, add a TagField parent element <TagField> </TagField> that contains the information about your data to be imported. All of your TagField elements are then contained within a <TagFields> </TagFields> parent element. The TagField element contains the following child elements:

XML ElementContentsExample
TagNameName of the tag where data will be archived<TagName>MyTag</TagName>
ColumnColumn in the flat file containing the tag data (0 indexed)<Column>1</Column>
RowThe first row in the flat file containing the tag data (0 indexed)<Row>3</Row>
TypeData type<Type>Double</Type>


When you are done, assemble the components into a FileConfig definition which should look like the example below:

 <FileConfig>
    <Name>MyFileIntegration</Name>
    <Path></Path>
    <FileType>MyDataFile.csv</FileType>
    <Recursive>true</Recursive>
    <MaxNumberOfLines>200</MaxNumberOfLines>
    <FileFormat>      
      <Separator>Comma</Separator>
      <TimeFields>
        <TimeField>
          <Type>DATETIME</Type>
          <Column>0</Column>
          <Row>1</Row>
          <Format>yyyyMMdd HH:mm:ss</Format>
        </TimeField>
      </TimeFields>
      <TagFields>
        <TagField>
          <TagName>Tag1</TagName>
          <Column>3</Column>
          <Row>1</Row>
          <Type>Double</Type>
        </TagField>
        <TagField>
          <TagName>Tag2</TagName>
          <Column>4</Column>
          <Row>1</Row>
          <Type>Double</Type>
        </TagField>
      </TagFields>
    </FileFormat>
  </FileConfig>



Step 2: Send the FileConfig definition to Bazefield Support

Ask us to add the FileConfig definition to your SAAS environment's SimpleFile integration service configuration, and that you want the Path element to point to the Bazefield Documents parent directory. Reference this Solution Article in your email. Bazefield Support will add the configuration to your SimpleFile integration service.


Step 3: Upload your files via the Operations Management Documents tool in the Bazefield Portal

Files can be uploaded via Operations > Operations Management > Documents > New Document.

NOTE: If admins at your organization do not see the Operations Management application, it's possible that it is not enabled for your installation. Contact Bazefield Support in order to enable the application.




After the document is saved through the Bazefield Portal, the Bazefield Integration Service will automatically detect the file and import the data it contains.


Notes

Your filename cannot contain the strings "Failed" or "Completed", or the Bazefield Integration Service will not detect the uploaded files.


Product Environment and Version


Bazefield Portal 8.0.15.9 or later

Bazefield Integration Service 2.3.30 or later