getData method
Information noteSTABLE.
This API is reliable and breaking changes are unlikely.
This API is reliable and breaking changes are unlikely.
qlik.app.field.getData(options)
Gets field data. The values are available as QFieldValue
in array field.rows and will updated when the selection state changes. Notification OnData
is triggered after each update.
Version history
Version state | Details |
---|---|
Introduced | 2.1 |
Parameters
options
Type: Object
Optional.
Properties:
Name | Type | Description |
---|---|---|
rows | Number |
Number of rows to fetch. Default: 200. |
frequencyMode | String |
Can be one of:
Default: V. |
Returns
A field object. The field object is filled with data when an OnData notification is triggered.
Examples
Example 1
require(["js/qlik"], function(qlik) {
// open the app
var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d', config);
// get data from a field
var myField = app.field("Month").getData();
myField.OnData.bind( function(){
myField.rows.forEach(function(row){
console.log(row.qElemNumber);
});
});
//select the field using indexes for January, February and March
myField.field("Month").select([0, 1, 2], true, true);
})
Example 2
require(["js/qlik"], function(qlik) {
// open the app
var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d', config);
// get data from a field
var myField = app.field("Month").getData();
myField.OnData.bind( function(){
myField.rows.forEach(function(row){
console.log(row.qElemNumber);
});
});
//select the field using values
myField.field("Month").selectValues(["January", "February", "March"], true, true);
})