N/dataset Module Members Reference for SuiteScript
Understand the N/dataset module members, including their types and methods for SuiteScript developers.
The N/dataset module provides a variety of objects and methods essential for creating and manipulating datasets in SuiteScript. Understanding its members can greatly enhance your ability to work with SuiteAnalytics data effectively.
What are N/dataset Module Members?
The N/dataset module contains several key members that facilitate the management of datasets, including the definition of columns, conditions, and the creation of dataset objects. Here’s a concise overview of these members:
| Member Type | Name | Return Type / Value Type | Supported Script Types | Description |
|---|---|---|---|---|
| Object | dataset.Column | Object | Server scripts | Represents a column in the dataset, typically corresponding to a record field. |
| Object | dataset.Condition | Object | Server scripts | Defines a condition or set of conditions to apply to a dataset column. |
| Object | dataset.Dataset | Object | Server scripts | Represents the entire dataset, encompassing its columns, conditions, and joins. |
| Object | dataset.Join | Object | Server scripts | Represents a joined record utilized in the dataset. |
| Method | dataset.create(options) | dataset.Dataset | Server scripts | Creates a new dataset. |
| Method | dataset.createColumn(options) | dataset.Column | Server scripts | Creates a new column for the dataset. |
| Method | dataset.createCondition(options) | dataset.Condition | Server scripts | Creates a condition to be used in the dataset. |
| Method | dataset.createJoin(options) | dataset.Join | Server scripts | Establishes a join for the dataset. |
| Method | dataset.describe(options) | Object[] | Server scripts | Retrieves descriptive information about a dataset, including columns and their properties. |
| Method | dataset.list() | Object[] | Server scripts | Lists all existing datasets available. |
How Do You Use N/dataset Members?
Understanding how to work with dataset members can significantly streamline data manipulation in SuiteScript. Below are example syntax usages for creating columns and conditions:
Creating a Column
// Create a general columnvar myFieldColumn = dataset.createColumn({ fieldId: 'name', id: 7});Creating a Condition
1// Create a condition with an operator2var myCondition = dataset.createCondition({3 column: myNameColumn,4 operator: query.Operator.EQUAL,5 values: ['smith']6});Key Considerations
- Make sure to replace ID values with those that are valid for your specific NetSuite account when working with datasets.
- Review the SuiteScript 2.x Script Types documentation to understand the limitations and supported features within server scripts.
In Summary
The N/dataset module plays a crucial role for developers aiming to leverage SuiteAnalytics datasets effectively. Its structured approach facilitates diverse operational needs, contributing to enhanced data queries and reporting capabilities within NetSuite.
Frequently Asked Questions (4)
Do I need to enable any specific feature flag to use the N/dataset module in SuiteScript?
What types of scripts support the use of dataset members such as Column, Condition, and Join?
Can the N/dataset module be used for client scripts, or is it limited to server scripts only?
What happens if I use an invalid ID value when creating a dataset Column or Condition?
Was this article helpful?
More in SuiteScript
- SuiteScript 2.1 Enhancements in NetSuite February Updates
SuiteScript 2.1 now supports async features and PATCH method. Discover the latest API and SuiteProcurement improvements.
- Scheduling Map/Reduce Script Deployments in NetSuite
Learn to schedule map/reduce script submissions, including one-time and recurring options in NetSuite.
- Binary File Support in N/https Module for SuiteScript
SuiteScript enhances capabilities with binary file support in the N/https module, allowing improved data handling in external communications.
- API Governance Units Calculation in NetSuite 2026.1
NetSuite 2026.1 introduces examples illustrating API governance unit calculations for both user event and scheduled scripts.
