dataset.Column

Object Description

Encapsulates the record fields in the dataset. Columns are equivalent to the fields you use when you build a dataset in SuiteAnalytics. For more information about datasets in SuiteAnalytics, see Custom Workbooks and Datasets.

Use dataset.createColumn(options) to create this object.

Supported Script Types

Server scripts

For more information, see SuiteScript 2.x Script Types.

Module

N/dataset Module

Methods and Properties

Column Object Members

Since

2020.2

Syntax

Important:

The following code sample shows the syntax for this member. It is not a functional example. For a complete script example, see N/dataset Module Script Samples. Also see the Tutorial: Creating a Dataset Using the Workbook API topic.

            // Add additional code
...
// Create a fieldId Column
var myFieldColumn = dataset.createColumn({
    fieldId: 'name',
    id: 7
});
// Create a formula/type Column
var myFormulaColumn = dataset.createColumn({
    formula: '{email}',
    type: 'STRING',
    label: 'Formula'
});
// Create a join Column
var myJoinColumn = dataset.createColumn({
    fieldId: 'name',
    join: myJoin,    // Create this using dataset.createJoin
    alias: 'my joined column'
});

// Load a dataset and view its Column (in the log)
var myDataset = dataset.load({
    id: 'stddataset_mydataset'    // Replace with a valid ID value for your account
});
var myColumn = myDataset.Column[0];

// (Note that some Column properties may be empty/null based on the loaded dataset)
log.audit({
    title: 'Column alias = ',
    details: myColumn.alias
});
log.audit({
    title: 'Column fieldId = ',
    details: myColumn.fieldId
});
log.audit({
    title: 'Column formula = ',
    details: myColumn.formula
});
log.audit({
    title: 'Column join = ',
    details: myColumn.join
});
log.audit({
    title: 'Column label = ',
    details: myColumn.label
});
log.audit({
    title: 'Column type = ',
    details: myColumn.type
});
...
// Add additional code 

          

Related Topics

General Notices