Remote Data
Remote data is a table like structure which is retrieved from remote source. The remote data must meet different requirements based on where and how it will be used in Perfion. If the original data in the remote data source is not compatible with Perfion defined data structure, then it has to be pre-processed, e.g. by using SQL query (if data source is a database) or OData query (if data source is an OData service). Data from the web service must already come in correctly prepared format because there is no other way to pre-process this data once it is received by Perfion.
Remote data has to be formatted in the same format regardless of where the data is coming from (OData, database or web service).
Single Type Data
The data from remote source is expected to have at least one “KEYVALUE” data column, which will be used for finding a match in Perfion data. Each row value in “KEYVALUE” data column must be unique and will be used to find equivalent item in Perfion. Example of Single type remote data:
KEYVALUE | Name | Price | Comment |
Product_1 | Table | 300 | Table price in DKK |
Product_2 | Chair | 100 | Chair price in DKK |
… | … | … | … |
Product_N | Painting | 150 | Painting price in DKK |
“KEYVALUE” in this example is a product number and it is unique for each product. In this case the same product number, as defined in “KEYVALUE” column, must also exist in Perfion. If the incoming value defined in KEYVALUE column is not found in Perfion, then it will be ignored.
For a most simple remote of Single type it is enough to have only one column of data (a “KEYVALUE” column), but one may have any number of extra data columns. Column names do not have any meaning (except for “KEYVALUE” column) and can be freely chosen by user. Perfion uses column names in a case insensitive manner, but we still recommend to use “KEYVALUE” column as it was shown in example table, e.g. with all capital letters.
The data returned by remote can be used by several remote features and for each remote feature user will be able to select remote data column as remote feature’s value.
Cluster Type Data
The data from remote source is expected to have variants for each retrieved item, e.g. to have at least two key columns instead of one. One column will be the “KEYVALUE” column as it was with Single data type, while the other column will be an item variant column named “VARIANT”. Cluster type data allows having multiple values for each item, but there is a requirement that each row must be unique using a combined value of “KEYVALUE” column and “VARIANT” column, e.g. for each “KEYVALUE” column value all “VARIANT” column values must be unique. Example of Cluster type remote data:
KEYVALUE | VARIANT | Name | Comment |
Product_1 | 300 | Table | Table price in DKK |
Product_1 | 40.3 | Table | Table price in EUR |
Product_2 | 100 | Chair | Chair price in DKK |
Product_2 | 13.5 | Chair | Chair price in EUR |
Product_2 | 15.7 | Chair | Chair price in USD |
… | … | … | … |
Product_N | 150 | Painting | Painting price in DKK |
Product_N | 23.5 | Painting | Painting price in USD |
As compared to the Single type data, the price was selected to be a variant for a product. The greyed out area in “VARIANT” column (in the table above) shows three price variants for item with “KEYVALUE” column value “Product_2” and all those marked values must be unique.
For a most simple remote of Cluster type it is enough to have two columns of data (“KEYVALUE” column and “VARIANT” column), but one may have any number of extra data columns.
Column names, like with Single type data, do not have any meaning (except for “KEYVALUE” and “VARIANT” columns) and can be freely chosen by user. Perfion uses column names in a case insensitive manner, but we still recommend to use “KEYVALUE” and “VARIANT” columns with all capital letters as it was shown in the table with data example.
The data returned by remote can be used by several remote features and for each remote feature user will be able to select chosen remote data column as remote feature’s value.
Localizable Data
Features in Perfion usually have only one data column with data, but if they have Localizable data property, then they may have one data column for each language used in Perfion. If remote is used with localizable remote feature, it must have a special data format. In the table below it is shown how the non-localizable (e.g. normal) remote data for remote feature looks like.
KEYVALUE | Name |
Product 1 | Product 1 name |
Product 2 | Product 2 name |
If the same data should be used with localizable remote feature, it has to be prepared differently. Example of localizable remote data:
KEYVALUE | Name_EN | Name_DE | Name_DAN |
Product 1 | Product 1 name in EN | Product 1 name in DE | Product 1 name in DAN |
Product 2 | Product 2 name in EN | Product 2 name in DE | Product 2 name in DAN |
The difference is that the data column of interest must have values for each language and remote data column names must be formatted using language code suffix.
Remote Data Usage in Perfion
Remote data usage in Perfion will differ based on which type of remote it is used with. In this section we will show an example of how data in Perfion can be mapped to the data coming from remote data source and then we will show how this example can be applied for different types of remotes.
NOTE: In this section we will show only the concept of how it works and all the details will be found in other sections of this manual.
Example data
Let’s say there are some products defined in Perfion with some basic data and that one needs to get some extra data from remote data source, e.g. from ERP system.
In our example we have cars as products as shown in Figure 1. The product has the following data columns: “Product (en)”, “Fuel”, “Engine Power[PS]” and “Item Number”. “Item Number” in this example is the unique product identifier.
Let’s say that remote data source has information about the same products which are in Perfion and then some extra, which is not available in Perfion. This is the data we have in remote data source:
ProductNr | CategoryID | UnitsInStock | UnitsOnOrder |
1 | 1 | 39 | 0 |
2 | 1 | 17 | 40 |
3 | 2 | 13 | 70 |
4 | 2 | 53 | 0 |
5 | 2 | 0 | 0 |
6 | 2 | 120 | 0 |
7 | 7 | 15 | 0 |
In order to use this data in Perfion we have to rename the column which will be used as identifier (key) for the data to “KEYVALUE”. In this case it is “ProductNr” column. It is also necessary to tell Perfion which feature in Perfion has the same product identifier, which can be matched to the data identifier in remote data source. In our example, that feature is “Item number” and it is called key feature. The retrieval of remote data in correct format and key feature specification is done in remote query setup. Refer to section Remote Query for more information.
The final data formatted to be suitable for use in Perfion as remote data will look like shown in the table below.
KEYVALUE | CategoryID | UnitsInStock | UnitsOnOrder |
1 | 1 | 39 | 0 |
2 | 1 | 17 | 40 |
3 | 2 | 13 | 70 |
4 | 2 | 53 | 0 |
5 | 2 | 0 | 0 |
6 | 2 | 120 | 0 |
7 | 7 | 15 | 0 |
Example Using Remote Feature
In order to use remote data in Perfion one has to create a remote feature and select which data column available from remote will be used for values of the remote feature. A feature in Perfion may have only one column with data, so if one wants to add several data columns to Perfion from the same remote, then an extra remote feature has to be created for each data column.
Let’s say we will use two data columns from remote data (from “Example data”): “UnitsInStock” and “UnitsOnOrder”. To get this data in Perfion we create two remote features and for one feature we select “UnitsInStock” as remote data field and “UnitsOnOrder” for the other one. Then, after adding both new remote features into the grid, we will have remote data retrieved live from the remote data source. The Figure 2 shows how the data looks like in Perfion. Remote features are shown in cells with light blue background and are read only, e.g. remote feature values cannot be modified.
Perfion will know how to show the data, because of key values in remote data and key feature specified in remote query. In this case Perfion will use “Item Number” feature from the grid as key feature and will search for its values in remote data “KEYVALUE” column. The selected remote data fields (“UnitsInStock” and “UnitsOnOrder” in this case) will be selected as actual remote feature values and shown in the grid.
The remote data when used with remote features are retrieved from remote source in real time. The data retrieval from remote sources could take more time as compared to normal features.
To optimize the process and to retrieve only the remote data which is actually used (shown), Perfion requires a special setup of remote query (refer to Remote Query for more information). If remote query is set up correctly, only the relevant data will be retrieved from remote data source to minimize delay and the data quantity needed to be downloaded from remote source. For example, there are only three products shown in the grid (refer to Figure 2), so there is no need to download data for all seven products which are available in remote data source. In this situation Perfion will know that there are only three products shown in the grid and will rearrange remote query to return only the data as shown in the table below:
KEYVALUE | CategoryID | UnitsInStock | UnitsOnOrder |
3 | 2 | 13 | 70 |
4 | 2 | 53 | 0 |
7 | 7 | 15 | 0 |
To get only relevant data from remote source, the key feature (“Item Number”) values found in the grid will be used in remote query when asking for data from remote data source.
Perfion also knows that in the grid there are more than one remote feature (e.g. “UnitsInStock” and “UnitsOnOrder”), which use the same remote query (e.g. the same data source) and it will make only one remote request to get the data from remote source in order to get the data. The data then will be reused with all remote features without a need to request the same data several times.
Similar optimizations will be also done when only a single product is selected for display, e.g. in Item Editor as shown in Figure 3.
In this case Perfion will retrieve only one row of remote data from remote source and will also reuse the same data for all remote features associated with the same product. The data Perfion will retrieve from remote source in this case:
KEYVALUE | CategoryID | UnitsInStock | UnitsOnOrder |
3 | 2 | 13 | 70 |
Example with Cluster Data
Cluster type data is different from Single type data only in a way that each data row may have multiple values. Since Cluster type data is not compatible with previous examples, we will use a new example data as shown in the table below.
ProductNumber | Name | Price | Currency |
1 | Product 1 | 10.60 | EUR |
1 | Product 1 | 12.37 | USD |
2 | Product 2 | 15.80 | EUR |
2 | Product 2 | 18.44 | USD |
3 | Product 3 | 1125.40 | EUR |
3 | Product 3 | 1313.67 | USD |
4 | Product 4 | 45.50 | EUR |
4 | Product 4 | 53.11 | USD |
5 | Product 5 | 89.10 | EUR |
5 | Product 5 | 104.01 | USD |
6 | Product 6 | 6.40 | EUR |
6 | Product 6 | 7.47 | USD |
Cluster type remote uses “KEYVALUE” and “VARIANT” columns for data synchronization (combined key value) and chosen remote data field as data value. Remote data after pre-processing incoming data:
KEYVALUE | Name | Price | VARIANT |
1 | Product 1 | 10.60 | EUR |
1 | Product 1 | 12.37 | USD |
2 | Product 2 | 15.80 | EUR |
2 | Product 2 | 18.44 | USD |
3 | Product 3 | 1125.40 | EUR |
3 | Product 3 | 1313.67 | USD |
4 | Product 4 | 45.50 | EUR |
4 | Product 4 | 53.11 | USD |
5 | Product 5 | 89.10 | EUR |
5 | Product 5 | 104.01 | USD |
6 | Product 6 | 6.40 | EUR |
6 | Product 6 | 7.47 | USD |
The “ProductNumber” data column was renamed to “KEYVALUE” and “Currency” data column to “VARIANT”.
The remote feature with Cluster type data usage will be very similar to remote feature with Single type data. The differences:
Remote feature with Single type data will have one value for each item, while Cluster type data will have multiple values.
Single type data can be showed in Perfion grid while Cluster data cannot. Cluster type data if shown in grid will be shown as remote feature data, but without any values (refer to Figure 4).
In Item Editor Cluster type data will be shown differently than Single type data. Instead of showing only one value like for Single type data, Cluster type data will be shown like a table with values from all data columns and with as many data rows as there are variants. Refer to Figure 5.
For example of remote feature with Cluster data (“FeatureWithClusterTypeData”) shown in Perfion grid refer to Figure 4.
Remote feature with Cluster data (“FeatureWithClusterTypeData”) in the Item Editor is shown in Figure 5. Item Editor here is loaded with product feature item with “ItemNumber” feature value equal to 3, which corresponds to the remote data, which has “KEYVALUE” column data set to 3, e.g. “Product 3” data.