dataset.Condition

Object Description

The conditions for the dataset. Conditions are equivalent to criteria you use when you build a dataset in SuiteAnalytics. For more information about criteria used in datasets in SuiteAnalytics, see Dataset Criteria Filters.

Use dataset.createCondition(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

Condition 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 Condition without values
var myCondition = dataset.createCondition({
    column: myNameColumn,
    operator: query.Operator.EMPTY
});

// Create a Condition with values
var myCondition = dataset.createCondition({
    column: myNameColumn,
    operator: query.Operator.EQUAL,
    values: ['smith']
});
// Create a Condition with children
var myCondition = dataset.createCondition({
    column: myNameColumn,
    operator: 'OR',
    children: myChildCondition    // Create this with a separate call to dataset.createCondition
});

// Load a dataset and views its Condition (in the log)
let myDataset = dataset.load({
    id: '1'    // Replace with a valid ID value for your account
});
var myCondition = myDataset.condition;

// Note that some Condition properties may be empty/null based on the loaded dataset
log.audit({
    title: 'Condition children = ',
    details: myCondition.children
});
log.audit({
    title: 'Condition column = ',
    details: myCondition.column
});
log.audit({
    title: 'Condition operator = ',
    details: myCondition.operator
});
log.audit({
    title: 'Condition values = ',
    details: myCondition.values
});
...
// Add additional code 

          

Related Topics

General Notices