When working with NetSuite Analytics Datasets (Workbooks), it’s often necessary to retrieve the underlying dataset schema—fields, joins, aggregations, types, and metadata. NetSuite does not expose a public REST API for this; however, its internal client-side API allows you to load dataset definitions using the remoteObject.bridgeCall method.
The getDatasetObject() function below demonstrates how to call this internal API safely and correctly.
How It Works
The function sends a POST request to NetSuite’s internal bridge endpoint to load the dataset structure using the command:
["queryApiBridge", "loadSearch", [datasetId]]
NetSuite processes this via its internal remote object and returns the dataset definition normally used by the Workbook UI.
Key Steps
- Generate the endpoint URL
- Uses
generateEndPoint()to point to NetSuite’s internal API gateway. - This endpoint is normally used by SuiteAnalytics Workbook.
- Build the bridge call payload
- The call uses:
jrid="0"jrmethod="remoteObject.bridgeCall"jrparams= JSON array specifying the bridge function and dataset ID.
- Use FormData (not JSON / URL params)
- NetSuite expects a multipart form request.
- No manual
Content-Typeheader is added becauseFormDatahandles boundaries automatically. - Send POST request with credentials
-
credentials: "include"ensures session cookies are sent, allowing the internal API to authenticate the user context. - Parse and return the dataset definition
- The response includes a
.result.resultproperty containing the full dataset metadata.
What You Get
The returned "datasetDefinition" includes:
- All dataset fields
- Field types and relationships
- Joins and sources
- Data source metadata
- Filters and query configuration
This is the same data the Workbook UI uses when rendering dataset fields.