NSOA.report.data(reportId,optionalParameters)

Use this function to read published report data available to the user executing the script. The function returns a specialized report data iterator (length, index, next, each).

For more information, see Business Intelligence Connector. See also OData Explorer to browse available OData resources and get started with a sample code, and NSOA.listview.data(listviewId) to read published list view data.

Note:

The Business Intelligence Connector feature must be enabled for your account to use NSOA.listview and NSOA.report functions. The Business Intelligence Connector feature is a licensed add-on. To enable this feature, contact your OpenAir account manager.

For more information about publishing list views and reports to the OpenAir OData service, see Business Intelligence Connector.

Parameters

Returns

Units Limit

Since

Example

          // get the iterator for report data; it has following members
// it consumes 10 units for each 1000-item page loaded into iterator on-demand
//  * 'length' - number of items
//  * 'index'  - index of last returned item
//  * 'next'   - returns next item from iterator or undefined when iterator is done
//  * 'each'   - calls specified function for each item in the iterator
//
// optionalParameters:
//  * 'select' - list of field names to be returned
//  * 'filter' - limiting condition
var iterator = NSOA.report.data(
    7,
    {
        select: ["Name", "Remaining Budget"],
        filter: "Name eq 'Nathan Brown'"
    }
);

// get number of records published
var row_count = iterator.length;

// grab first two records
var first  = iterator.next();
var second = iterator.next();

// process rest of the report
iterator.each(function(record, index) {

    // search for particular name
    if (record.Name === "Nathan Brown") {

        // set the field value
        NSOA.form.setValue("remaining_budget__c", record["Remaining Budget"]);

        // stop iterating
        return false;
    }
});