The ability to retrieve additional data from Custom Data tables in SmartHub comes in the form of a the function GetHubCustomTableColumnValues() which has the following signature:
GetHubCustomTableColumnValues(hubId, tableId, key)
Note: Only Hubs linked to the survey can be used (otherwise will fail silently during data collection)
As you can see from this screen shot, this returns an object that allows you to use the following methods:
ContainsKeys: Allows you to check if an additional column or “key” exists (based on the name of the column
Count: Returns the count of the additional columns
GetValue: Returns the value of a specific additional column for that ID
Keys: Returns the list of additional columns names
Values: Returns the list of values for all additional columns for the selected item
Example
function getColumnValue(column) {
var key = f('q1').get(), hubId = 380054, tableId = 1;
var data = GetHubCustomTableColumnValues(hubId, tableId, key);
return data.GetValue(column);
}
I then piped the values in using this info node:
Car code = ^getColumnValue('carCode')^
English Model label = ^getColumnValue('car.l9')^
German Model label = ^getColumnValue('car.l7')^
Region = ^getColumnValue('region')^