Skip to main content
Announcements
Qlik Connect 2024! Seize endless possibilities! LEARN MORE
cancel
Showing results for 
Search instead for 
Did you mean: 
davidmartinezvazquez
Contributor
Contributor

Get possible count in Mashup

Hi,

I need to get the possible values of a field in a mashup.

Using console.log(app.field("field name").getData()) I can see that there is an object named stateCounts that has the info i need (qOptions), but i cant get it.

Tried app.field("fieldname").getData().stateCounts but it returns undefined.

Is there a way to get that information?

 

 

Labels (1)
  • API

1 Reply
alex_colombo
Employee
Employee

Hi @davidmartinezvazquez , you can use createGenericObject method from CapabilityAPIs for evaluating your Qlik Sense expression directly in the mashup. This allows you to have the same result of GetPossibleCount execute in Qlik Sense app.

Below an example. Any time the selections will change, you will receive the reply and you can handle the new value. Keep in mind to destroy the session object as soon as you don't need it anymore.

var app = qlik.openApp('cd5a3779-1d36-45c8-a343-12552755914c', config);
	
app.createGenericObject( {
	  text: {
		qStringExpression: "=GetPossibleCount(Date)"
	  }
	}, ( reply) => {
	  console.log(reply)
	  //app.destroySessionObject(reply.qInfo.qId)
});