Source: PP.TS.WbkDocument
The Source property sets data source for observation attributes panel in the workbook.
Property value can be set from JSON or using the setSource method. You cannot get the property value.
To execute the example, the HTML page must contain the WorkbookBox component named workbookBox (see Example of Creating the WorkbookBox Component). Get key of the data source for observation attributes panel in the workbook:
// Get workbook properties panel
var propertyBar = workbookBox.getPropertyBarView();
// Get observation attributes panel
var observeAttributesPanel = propertyBar.getObserveAttributesPanel();
// Set data source for this panel if it is missing
var source = observeAttributesPanel._Source; // Get data source
if (source == null | source == undefined) {
observeAttributesPanel.setSource(workbookBox.getSource());
console.log("Data source key: " + workbookBox.getSource().getKey());
} else {
console.log("Data source key: " + source.getKey());
};
After executing the example the browser console displays key of the data source for observation attributes panel in the workbook:
Data source key: 2944
See also: