Combined Data Sources in EasyCatalog allow you to combine data from separate data sources into a single panel. By specifying a series of simple rules that determine how data from one data source relates to data from another data source, you can quickly build complex data structures without having to write SQL.
A Combined data source is used as a โparentโ for other โchildโ data sources: the original child data sources remain independent of the combined data source. Child data sources can be optionally synchronized with their source data when the Combined data source is updated.
Creating a Combined Data Source
Combined data sources are created using the File โ New โ EasyCatalog Panel โ New Combined Data Source menu option. The “Combined Data Source Configuration” allows you to import the child data sources and specify how they related to each other.
This dialog is split in to three main areas:
Name/Data Source Field Name
Specify the name of the Combined Data Source, which must be a unique data source name.
To track which child data source data was imported from, EasyCatalog creates a field in the Combined data source using the name specified by the “Data Source Field Name” field. The name specified here must not appear in any of the child data sources. The default value – “datasource” – will normally be correct, but should be changed if one of your child data source contains a field named “datasource“.
Data Sources
The data sources that have been imported into the Combined Data Source can be managed using this list. Note that deleting a data source from this list will also remove any relationships that use it in the ‘Combined Data’ list.
To import an existing data source, use the “New…” button:
Your existing EasyCatalog data sources will be shown in the “Data Source” popup.ย When importing data into the Combined Data Source, the key field values and field names need to be unique across all child data sources.ย To ensure this, the value in the “Key Prefix” field will be prepended to the key field values imported from this data source; the value entered in the “Field Prefix” will be prepended to the field names imported.
Combined Data
The Combined Data area allows you to define the relationships between the data sources – for example, how the data from one data source relates to another.ย This enables you to defined parent/child data relationships.ย The relationships are defined using a series of simple logic statements.
A hierarchy of data sources can be created by either:
- dragging and dropping the data source(s) from the Data Sources list to the Combined Data list, or
- by selecting the data source in the top list and using the “Add…” button in the Combined Data area.
To create a parent โ child relationship between two data sources, either:
- Drag the child data source on top of the ‘parent’ data source, or
- Select the ‘parent’ data source in the “Combined Data” list before pressing the “Add…” button in the Combined Data area.
The configuration of the relationships is best described using a simple example.
Example Configuration
For this example, we have imported two data sources: one containing a list of products, another containing specifications for those products.ย In the Specifications data source there is one row per specification, and each row contains the product code that the specification relates to.
The sample files for this example can be downloaded from the following two links:
To configure a panel that links the specifications to the products, we first need to import the two data sources using the “Add…” button in the “Data Sources” panel at the top of the dialog.
In the “Combined Data” list we have defined how the two data sources relate to each other – i.e. the Product List is the parent, with the specifications listed as “children” underneath.ย We want all “Products” to appear in the panel, so the configuration for this level is straightforward:
The “Records” pop-up is set to “All”, to specify that we want all records to be returned for this data source. We have already told EasyCatalog that the two data sources are related to each other, but we haven’t defined how they are related.ย This is achieved by editing the “Specifications.xlsx” level:
This dialog allows you to specify logic that determines which records appear under each parent row.ย There are two types of rows in this table:
Logic
Logic rows can be one of two types:
- “All of the following conditions are met” – all of the conditioned listed underneath must evaluate to true in order for the record to appear in the panel
- “Any of the following conditions are met” – if any one of the conditioned listed underneath evaluate to true the record will appear in the panel
Each logic row can contain either a condition by using the “Add…” button or another (see below) or another logic row (by using the “Add Level…” button).
Condition
Conditions can be one of two types – either comparing the contents of a field with:
- A fixed, constant, value
- The contents of another field
So, in the above example, we want to import specification records where the Part Code field in the Specifications data source is the same as the Part Code in the Product List data source.
Combined Data Panels
A combined data panel behaves much the same as a regular data panel and so all of the regular panel’s options are available.ย The field specified as the ‘data source’ field in the Combined Data Source configuration will be added to the data to show the name of the original data source that contains the records shown in the row.
Using the example from above, EasyCatalog has imported every record from the Product List data source, and for each record it imports it then imports the records specified by the criteria we specified: the records shown beneath each Product List record from the Specifications data source match on Part Number.
Fields that do not exist in the record for the row are shown with a checkerboard background.