Data Properties
From SpinetiX Support Wiki
This page is related to Data-driven widgets page.
Contents
Introduction
The "Data Properties" dialog (previously named "Data Feed Properties") allows configuring the properties related to the data source from where the data-driven widgets can retrieve data.
To open the "Data Properties" dialog, click on the button, on the "Data source" property of any data-driven widget. At any point, the data source configuration can be tested by clicking the "Test..." button.
The dialog contains the following tabs:
Source tab
Applies to Elementi S and Elementi M.
The "Source" tab allows configuring the following properties:
- URI
- Enter the URI from where the data is retrieved. This can be a local path into the project or a remote http(s) address.
- Refresh (added in 3.1.0)
- Enter a number, optionally followed by
s
(implicit),m
orh
, to specify the period after which the widget should refresh the feed data (this is useful especially when the widget is running in a loop). Enter0
or the keywordnever
to prevent the data refresh. - Note: The minimum accepted value is 10 seconds.
- Enter a number, optionally followed by
- Limit
- Enable this option and specify the maximum number of items (rows) to be kept from the data set (starting from the first row).
Parser tab
The parser tab configuring properties specific to the type of parser determined by the data-driven widget type. Note that the "RSS parser" and "Text parser" do not expose any properties within Elementi S and Elementi M.
Fallback tab
The "Fallback" tab allows defining some fallback values, as following:
- Entry
- Enter the name of the field / column; for RSS and calendar feeds, the name of the fields are already populated.
- Default
- Enter the default value to be used when the data for the specified column is missing from the result row. Note that this value in not used when there are no data at all (e.g., the data feed cannot be retrieved or there are no results to be displayed). For instance, you can specify a default image to be used in case the RSS feed does not provide an enclosure field.
- Placeholder for edition
- This value has no influence other than "cosmetic" and is used when switching a data-driven widget into edit mode (i.e. clicking once on the Preview panel); to edit the layer, click a second time on the field layer - the data placeholder (e.g.,
[[field]]
) can now be edited.
- This value has no influence other than "cosmetic" and is used when switching a data-driven widget into edit mode (i.e. clicking once on the Preview panel); to edit the layer, click a second time on the field layer - the data placeholder (e.g.,
Advanced configuration
Applies to Elementi X
The "Data Properties" dialog contains much more options for Elementi X users:
- Type
- Select the type of data source from the following: URI (default), Shared Variable, Inline data, Query String, Foreign Exchange and Finance, Spreadsheet and Spreadsheet Chart, Calendar, Media, Social Network (Twitter, Facebook, Yammer), Weather.
- URI / Variable / Selector
- Enter the data source location / name of the Shared Variable / or inline selector.
- Parser
- Select the main parser that is applied onto the raw data retrieved from the data source. It can be one of the following: RSS, XML, JSON, CSV, RegExp, ICS, Script, Directory Listing, or Query String.
- Format
- Add additional formatting rules on the fields returned by the main parser, as following:
- In the first box, enter (or select if available) the target field.
- In the second box, select the format parser / filter from RSS, XML, JSON, CSV, RegExp, ICS, Script, Query String, Date/Time, Num. Filter, Date Filter, or String Filter.
- Click on the "Add" button.
- This will create a new tab containing further options to configure. To remove the parsing rule, click on the red icon on its tab. It is possible to add as many formatting rules as needed.
- Add additional formatting rules on the fields returned by the main parser, as following:
- Sort
- Add one sorting rule to be applied to the data, as following
- Enable the "Sort" option.
- In the first box, enter (or select if available) the target field.
- In the second box, select the sort type from "Alphabetical", "Numerical" or "Chronological".
- In the third box, select the sort direction from "Ascending" or "Descending".
- Add one sorting rule to be applied to the data, as following
- Limit
- Enable this option and specify the maximum number of items (rows) to be kept from the data set (starting from the first row).
- Synchronize with variable (Sync variable)
- Enter the name of the remote Shared Variable that will be used for data feed synchronization. Added in Elementi 2015 X.
Type : URI
The data source is a remote resource retrieved from an HTTP(S) server (using a GET request). The following properties are related to this type:
- URI
- Enter the address from where the data is retrieved.
- Refresh (added in 3.1.0)
- Specify the period after which the widget should refresh the spreadsheet data (this is useful especially when the widget is running in a loop); either select one of the provided options ("When document opens", 5m, 10m, ... , 24h) or enter a number, optionally followed by
s
(implicit),m
orh
; the minimum accepted value is 10 seconds. Using "When document opens
" will refresh the data only when the document is re-opened.
- Specify the period after which the widget should refresh the spreadsheet data (this is useful especially when the widget is running in a loop); either select one of the provided options ("When document opens", 5m, 10m, ... , 24h) or enter a number, optionally followed by
The data source is a Shared Variable (its value is used as data), thus the data will be updated each time the Shared Variable is modified. The following properties are related to this type:
- Variable
- Enter the name of the Shared Variable containing the data.
- Synchronize with source
- Enable this option to synchronize the data update with the Shared Variable timestamp (useful for synchronized content).
Type : Inline data
The data source is an element (typically a text) present within the current document. The following property is related to this type:
- Selector
- Enter the CSS3 selector syntax to identify where the data is located within the current document. For instance using
title
will use the content of the first<title>
element in the document as the data source.
- Enter the CSS3 selector syntax to identify where the data is located within the current document. For instance using
Type : Query String
Added in Elementi 3.1.0.
The data source is the list of parameters (i.e. query string) passed through the document URI. There are no particular properties for this type.
Feed Test dialog
To test the data source configuration of a data-driven widget, click the "Test..." button within the "Data Properties" dialog - the results are shown in the "Feed Test" dialog.
The usual tabs that are shown within the "Feed Test" dialog are:
- Source (n bytes)
- If present, this tab displays the raw data as retrieved from the data source.
- Parser (n rows)
- This tab shows the results returned by the main parser, the resulted data being arranged in a table-like format, with columns and rows. The column names are used as data placeholders with the widget layout. For instance to display the content of the column called "title", use
[[title]]
when editing the layout.
- This tab shows the results returned by the main parser, the resulted data being arranged in a table-like format, with columns and rows. The column names are used as data placeholders with the widget layout. For instance to display the content of the column called "title", use
- In case an "Operation Failed" error is displayed instead of the actual data and the widget is included into a playlist, open only the widget from Browse panel and try again. If the error persists, try to increase the widget duration so that it will not loop too fast.
- For Elementi X users, the "Data Feed Properties" dialog offers advanced options for more complex data processing - depending on the additional parser and formatting options applied, more tabs could be displayed within the "Feed Test" dialog. For instance, when applying a "Date/Time" parser on a column named "date", a third tab is added - "Date/Time on 'date' (n rows)"; applying a sorting option, also generates an additional tab, "Sort".