Skip to main content Skip to complementary content

getData method

Information noteSTABLE.

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 history
Version state Details
Introduced 2.1

Parameters

options

Type: Object

Optional.

Properties:

options object properties
Name Type Description
rows Number

Number of rows to fetch.

Default: 200.

frequencyMode String

Can be one of:

  • V=Absolute
  • P=Percent
  • R=Relative
  • N=No frequency

Default: V.

Returns

A field object. The field object is filled with data when an OnData notification is triggered.

Examples

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);
})
Same example as above but using selectValues instead of select for selecting actual values
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);
})

Learn more

 

Did this page help you?

If you find any issues with this page or its content – a typo, a missing step, or a technical error – let us know how we can improve!