TX Sheet Control

DashboardAnalytics.setData Method

Method

Replaces a connector source's transient snapshot atomically after validation. Rows are detached, bounded to 250,000 cells and cleared on document replacement. Existing queries, joins and widgets use the same field IDs as worksheet sources.

Owner: DashboardAnalytics. Package: @txtextcontrol/tx-sheet-control. Version: 2.0.0.

Syntax

owner.setData(sourceId, data)

Parameters

ParameterTypeOptionalDescription
sourceIdstringNoValue matching sourceId's declared type and the owning object's validation rules.
dataAnalyticsDataNoApplication-supplied data matching the documented schema.

Return Value

void.

Examples

Use a fresh sample workbook for this example. In the browser pass editor.workbook; in Node.js pass the server control. Document-bound objects are obtained from that same owner.

function supplySalesSnapshot(book) {
    book.analytics.setSource({
        id: 'imported-sales',
        name: 'Imported sales',
        connectionId: 'sales-service',
        queryId: 'regional-sales',
    });

    book.analytics.setData('imported-sales', {
        columns: ['Region', 'Revenue'],
        rows: [
            ['North', 42000],
            ['South', 38500],
        ],
    });
}

Remarks

Use this member on an object from the current document. Reacquire document-bound handles after replacement/deletion. Validate arguments against the declared types and documented bounds; handle exceptions or rejected promises.

See Also