Skip to main content

CSV

To import a large amount of data you can a CSV or JSON file. In the sidemenu click on Importers and create a new importer. Enter a name of the importer and past the contents of the CSV in the data window. It is also possible to automatically load a CSV file via HTTP or SSH as will be discussed later.

Key mapping

In the detail screen select the option Key from the menu. The key defines the topic and the formula refers to one or more columns in the CSV header. You can use any JavaScript expression.

Test import

To test the importer click on the Test icon or select Test from the menu. The output is shown in a table. Note that fields that end with time, latitude or longitude are not imported as separate topics but are used to set the place and time for the other parameters. When the test results look good select Run to import the data

Time line

To view the results graphically select States from the side menu. In the field From select Last decade and in the field Until select Now. Press Update to retrieve the data. Click the tab Timeline or Map to see the import results.

Object mapping

You can also use the CSV import to create more complex topics that refer to different objects. The example below shows the import of room data where field roomnumber is used the define the topic. Select Object from the menu to create a new mapping between a topic and an external object such as a room number. In the Object field you can use any JavaScript expression that used the values defined in the import data. For example, in this case the topic is set to the variable in the field roomnumber preceeded by a string. The import results are mapped as [topic][roomnumber][key]. For the field temperature a JavaScript expression is used to convert the source data from Fahrenheid to Celcius.