Skip to main content
Version: 11.2

Rowset.populate()

note

This article is about the populate() function of the Rowset object.

Rowset.populate()

Fills a Variable data source's row set with client-supplied records, bypassing a server query. This only works for a row set whose data source has type() equal to 'Variable'. Any existing records in the row set are cleared first.

Returns a UdbPromise object with the UdbRowSets object as parameter.

Syntax

$.udb( *ds* ).rowSet( *rowSet* ).populate( *table* )
.then( ( *row-set* ) => {
// success
})
.catch(() => {
// failure
});

The required ds parameter is a data source selector.

The required rowSet parameter is a rowset identifier.

The optional table is an array of plain objects (column name/value pairs) or UdbRecord instances, one for each record to add to the row set. If omitted, the row set is simply cleared.

Example

$.udb('EMP_VARSET').rowSet('current').populate([
{ EMPNO: '1', NAME: 'John' },
{ EMPNO: '2', NAME: 'Jane' }
]);
EventApplies toOccurs when
showdataData source objectsNew data is available for display.