Skip to main content

Working with DataSets

With a DataSet you design and store a table of data, which is created and managed separately from Layouts and Playlists.

After creating a DataSet, you add it to Layouts and Playlists with the DataSet Widget.

tip

You can also use a DataSet to build your own RSS feed for the Ticker Widget.

What DataSets can do:​

  • Let you define the structure of the data.
  • Accept data typed in by hand.
  • Load data from a file in CSV format.
  • Use a data source in JSON format through the API.
  • Synchronise with a remote third-party data source on a schedule.
  • Keep content up to date without opening Layouts or Playlists.
  • Be reused in several Widgets, Layouts and Playlists.
  • Produce an RSS feed.

DataSets are very versatile: you can set them up in many ways with the DataSet Widget, or use them to feed a custom Module. They are a convenient way to bring in data from other systems and display it.

Some examples of where a DataSet is useful:

  • The drinks list of a bar
  • The starting times at a golf club
  • Meeting room reservations
  • Bus timetables

Because they are managed separately from Layouts and Playlists, Users can add and maintain the data of a DataSet without having access to Layouts, the Layout Editor or Playlists.

How to create a DataSet​

You create and manage DataSets under DataSets, in the Library section of the CMS main menu.

  • Press Add DataSet and fill in the form to create a record
  • Enter a Name that makes the DataSet easy to recognise in the CMS. You can also add an internal Description, and a Code if you will refer to this DataSet through the API.

If the DataSet is going to synchronise with a Remote data source, tick the option and carry on with the steps for remote DataSets below.

If it is not Remote, press Save and continue with the section about creating and setting up Columns.

DataSets with a remote source​

A remote DataSet is a special kind that synchronises from a third-party data source at intervals. Recubik calls the URL as often as you choose and reads the data following the instructions in the DataSet record and in any Columns defined as Remote.

When you select Remote, extra tabs appear so that you can complete the record:

Remote DataSet Options

  • Remote​

    Choose the type of request and enter the URL of the remote data source.

  • Authentication​

    Enter the authentication details. In Custom Headers you can also add your own string of HTTP headers.

  • Data​

    Define the remote data source:

Reading JSON data​

JSON data fills the Columns that are defined with a Remote type. For each Remote Column you enter a 'data path': the JSON syntax path to the data of that column, starting from the Data Root you have set.

Take this JSON data source as an example:

{
"base": "EUR",
"date": "2017-12-22",
"rates": {
"GBP": 0.88568,
"THB": 38.83,
"USD": 1.1853
}
}

To have two columns for the Symbol and the Value of each currency, set Data Root to rates and create these Columns:

  • Symbol, with data path 0
  • Value, with data path 1

Press Test data URL to check that the structure you expect comes back.

Reading CSV data​

You can also choose CSV as the format of the remote data source.

If the CSV has headers, tick the option to skip the first row.

Press Test data URL here too, to check the structure that is returned.

Advanced​

  • Choose how often the remote data is fetched and imported.
warning

By default, the task that fetches remote DataSets runs every hour. Remote DataSets are meant for data that does not change often, not for real time data.

  • Set a time scale for truncating the data.
  • If you use dependants, choose a DataSet from the list.
  • You can also set a limit of rows and say what happens when it is exceeded.

If you do not set a Row Limit here, a self-hosted CMS applies the Row Limit defined in CMS Settings.

  • Press Save.

Setting up the Columns​

Columns give your data its structure:

  • Open the row menu of a DataSet and choose View Columns
tip

Every new DataSet starts with a column called Col1. Edit it or delete it from its row menu.

  • Delete Col1 from its row menu and press Add Column to create a new one

​ or

  • Open the row menu of Col1 and choose Edit.

DataSet Columns Form

  • Give the column a Heading that identifies it.
  • Choose the Type of Column from the list.

The types of Column:​

Value​

Holds a list of items offered in a combo box.

  • Choose the Data Type from the list.
  • Enter the values that can be selected in this column, separated by commas.
  • Set the position of the Column when data is viewed or edited.
  • If you wish, write a tooltip to be shown while data is typed into this column.

More options let you turn on Filters, Sorting and Required Values for the column.

Formula​

Works from a MySQL statement.

  • Choose the Data Type from the list.
  • Set the position of the Column when data is viewed or edited.
  • Enter a MySQL statement that is valid inside a 'SELECT', or a string that formats a date field.
info

$dateFormat(<col>,<format>,<language>) For the date format to work, <col> must hold a date and a time. If you set no language, English is used.

info

Formula columns accept two substitutions, [DisplayId] and [DisplayGeoLocation]. When the formula runs, they are replaced by the Display ID and the Display Geo Location (MySQL GEOMETRY).

More options let you turn on Filters and Sorting for the column.

Remote​

Takes a string in JSON syntax.

  • Choose the Data Type from the list.
  • Enter the JSON syntax string that shows how to reach the data in the third-party source.
  • Set the position of the Column when data is viewed or edited.

More options let you turn on Filters and Sorting for the column.

Add and set up as many Columns as you need. In theory there is no limit to the number Recubik supports, although a smaller DataSet is usually easier to manage and to display.

From the DataSets page, the row menu of a DataSet lets you view, add and edit its Columns.

You can still change the order of the Columns, and their list content, after data has been collected.

Putting data into the Columns​

When the Columns are defined, it is time to add data. There are several ways:

  • By hand, in the CMS user interface
  • Importing a CSV file
  • Through the API
  • By remote synchronisation

Typing it in​

You add data with the View Data button, next to Add Column.

tip

You can also view, add and edit data from the row menu of a DataSet on the DataSets page.

  • Press Add Row and fill in every column that is not a formula.
  • Press Next to carry on and add more rows.
  • When all the data is in, press Save
tip

To delete many rows at once, select them and use the Delete Selected action.

Using a CSV file​

The CMS has an importer that takes data from a CSV file and puts it into a DataSet. Import CSV is in the row menu of every DataSet, except those set up with a remote data source.

The importer has options to overwrite existing data. If your file has headings, there is also an option to skip its first row.

The Remote Columns of the DataSet are listed, each with a field where you enter the number of the CSV column that matches that heading.

warning

If your data has non-ASCII characters, which are very common in languages other than English, make sure the CSV file uses the right encoding. The most common one is UTF-8.
If you edited the file with Excel, choose "Unicode (UTF-8)" under Tools -> Web Options -> Encoding in the 'Save as' dialogue.

Sending it through the API​

You can write your own application that synchronises data into a DataSet with the Recubik API, either row by row or by importing complete JSON structures.

The API is covered in the Developer section of this manual.

Synchronising from a remote source​

A task called Fetch Remote DataSets keeps remote DataSets synchronised. It is set up by default and runs once a minute.

  • Dependents​

    A remote DataSet may depend on another one to build its request. For each row of that other DataSet, a request is made using the request parameters of the parent DataSet.

Actions in the row menu​

The row menu of each DataSet gives Users a list of actions and shortcuts.

  • These are the main ones:

View RSS​

Publishes the data of a DataSet as an RSS feed of your own.

  • Choose View RSS in the row menu of a DataSet.
  • Press Add RSS.

Add RSS

  • Fill in the form, choosing which Columns to use.
  • When you save, a URL is generated. Copy it into the Ticker Widget.

Delete​

A DataSet that is in use cannot be deleted.

To delete several at once, select them and use the With Selected option at the bottom of the DataSets grid.

Share​

Sets which Users or User Groups can access each DataSet.