Constructor
new SpotfireDataTable(dataTableDescription)
Parameters:
Name | Type | Description |
---|---|---|
dataTableDescription
|
DataTableDescription ▼ | |
name
|
String | The name of the data table. |
fromUrl
|
String | The URL of the source. |
addedColumnsDefinitions
|
AddedColumnsDefinition ▼ | Array of columns to add (calculated column, etc ...). |
[].name
|
String | The name of the column to add. |
[].type
|
SpotfireDataColumnsTypes {Enum} ▼ | The type of the column to add from |
Enum options: calculatedDataColumn | ||
importedDataAsColumns
|
ImportedDataAsColumnDefinition ▼ | Array of columns to import. |
[].urlSource
|
String | The URL of the source containing the columns to be imported. |
[].dataTableTarget
|
String | The name of the data table in which new columns will be imported. |
[].targetIdColumn
|
String | The name of the column in the target data table to use for the matching. |
[].sourceIdColumn
|
String | The name of the column in the source data table to use for the matching. |
[].otherColumnsMatching
|
Array.<ColumnMatching> ▼ | Array of the description of other column matches. |
[].targetColumn
|
String | The name of the column in the target data table to use for the matching. |
[].sourceColumn
|
String | The name of the column in the source data table to use for the matching. |
[].replaceCommonColumns
|
Boolean | Specifies whether the columns in the target data table should be replaced by the imported columns if they are common. Otherwise, the name of imported columns will be indexed. |
[].columnsToReplace
|
Array.<String> | Columns to be replaced by the imported data. |
importedDataAsRows
|
ImportedDataAsRowDefinition ▼ | Array of rows to import. |
[].urlSource
|
String | The URL of the source containing the columns to be imported. |
[].dataTableTarget
|
String | The name of the data table in which new rows will be imported. |
[].ignoredColumn
|
Array.<String> | The list of columns to be ignored during importation. |
[].rowSourceColumn
|
String | The column that identifies the origin of the row. |
[].rowSourceValue
|
String | The value that identifies the source of the row from the imported source. |
[].originalRowSourceValue
|
String | The value that identifies the source of the row from the target data table. |
[].mappings
|
Array.<ColumnMatching> ▼ | The list of columns to map between imported rows to existing rows. If not set, all common columns are merged. If set, common columns will be created with an indexed name. |
[].targetColumn
|
String | The name of the column in the target data table to use for the matching. |
[].sourceColumn
|
String | The name of the column in the source data table to use for the matching. |
properties
|
DataTablePropertyDefinition ▼ | Array of data table properties. |
[].name
|
String | |
[].value
|
string | boolean | number |
Methods
getAddedDataColumns(columnName) → {Object|null}
Get corresponding column to be created that has the name
Parameters:
Name | Type | Description |
---|---|---|
columnName
|
String | the added column name searched |
getImportedDataColumns(importedColumnDescription) → {Object|null}
Get the corresponding import as columns definition
Parameters:
Name | Type | Description |
---|---|---|
importedColumnDescription
|
Object | the searched column description |
- returns the search import definition if it exists or null if not
getImportedDataRows(importedColumnDescription) → {Object|null}
Get the corresponding import as rows definition
Parameters:
Name | Type | Description |
---|---|---|
importedColumnDescription
|
ImportedDataAsRowDefinition ▼ | the searched row description |
urlSource
|
String | The URL of the source containing the columns to be imported. |
dataTableTarget
|
String | The name of the data table in which new rows will be imported. |
ignoredColumn
|
Array.<String> | The list of columns to be ignored during importation. |
rowSourceColumn
|
String | The column that identifies the origin of the row. |
rowSourceValue
|
String | The value that identifies the source of the row from the imported source. |
originalRowSourceValue
|
String | The value that identifies the source of the row from the target data table. |
mappings
|
Array.<ColumnMatching> ▼ | The list of columns to map between imported rows to existing rows. If not set, all common columns are merged. If set, common columns will be created with an indexed name. |
[].targetColumn
|
String | The name of the column in the target data table to use for the matching. |
[].sourceColumn
|
String | The name of the column in the source data table to use for the matching. |
- returns the search import definition if it exists or null if not
getProperty(propertyName)
Get the property definition with the corresponding name
Parameters:
Name | Type | Description |
---|---|---|
propertyName
|
setAddedColumns(columnDefinitionsArray)
Set or update a definition of column to add for the applyState
Parameters:
Name | Type | Attributes | Default | Description |
---|---|---|---|---|
columnDefinitionsArray
|
Array | array of columns description to be added |
||
type
|
SpotfireDataColumnsTypes {Enum} ▼ | the type descriptor of the columns to be added. |
||
Enum options: calculatedDataColumn | ||||
expression
|
String |
<optional> |
Mandatory for SpotfireDataColumnsTypes.calculatedDataColumn. Define the expression to calculate the value |
|
isFrozen
|
Boolean |
<optional> |
false | set if the calculated column is frozen or not |
setImportedDataAsColumns(importedColumnsDefinitionsArray)
Set the list of imported data as columns definition.
Parameters:
Name | Type | Description |
---|---|---|
importedColumnsDefinitionsArray
|
ImportedDataAsColumnDefinition ▼ | The list of the import description. |
[].urlSource
|
String | The URL of the source containing the columns to be imported. |
[].dataTableTarget
|
String | The name of the data table in which new columns will be imported. |
[].targetIdColumn
|
String | The name of the column in the target data table to use for the matching. |
[].sourceIdColumn
|
String | The name of the column in the source data table to use for the matching. |
[].otherColumnsMatching
|
Array.<ColumnMatching> ▼ | Array of the description of other column matches. |
[].targetColumn
|
String | The name of the column in the target data table to use for the matching. |
[].sourceColumn
|
String | The name of the column in the source data table to use for the matching. |
[].replaceCommonColumns
|
Boolean | Specifies whether the columns in the target data table should be replaced by the imported columns if they are common. Otherwise, the name of imported columns will be indexed. |
[].columnsToReplace
|
Array.<String> | Columns to be replaced by the imported data. |
setImportedDataAsRows(importedRowsDefinitionsArray)
Set the list of imported data as rows definition.
Parameters:
Name | Type | Description |
---|---|---|
importedRowsDefinitionsArray
|
ImportedDataAsRowDefinition ▼ | The list of the import description. |
[].urlSource
|
String | The URL of the source containing the columns to be imported. |
[].dataTableTarget
|
String | The name of the data table in which new rows will be imported. |
[].ignoredColumn
|
Array.<String> | The list of columns to be ignored during importation. |
[].rowSourceColumn
|
String | The column that identifies the origin of the row. |
[].rowSourceValue
|
String | The value that identifies the source of the row from the imported source. |
[].originalRowSourceValue
|
String | The value that identifies the source of the row from the target data table. |
[].mappings
|
Array.<ColumnMatching> ▼ | The list of columns to map between imported rows to existing rows. If not set, all common columns are merged. If set, common columns will be created with an indexed name. |
[].targetColumn
|
String | The name of the column in the target data table to use for the matching. |
[].sourceColumn
|
String | The name of the column in the source data table to use for the matching. |
setProperties(arrayOfProperties)
Set the list of properties to be added to the dataTable
Parameters:
Name | Type | Description |
---|---|---|
arrayOfProperties
|
Array | the list of properties to be added |
name
|
String | the name of the property to be added |
value
|
String | Boolean | Number | the value of the property to be added |
validatePropertyDefinition(propertyDefinition)
Validate the property definition.
Parameters:
Name | Type | Description |
---|---|---|
propertyDefinition
|
DataTablePropertyDefinition ▼ | the definition to be validated |
name
|
String | |
value
|
string | boolean | number |
"Value can\'t be object or array. Please correct and retry." if value is of type object
"Property name must start with a letter and contains only letter and digits (no white space, or special characters)" if property name is not spotfire compliant