# createGenericObject method

Information note**STABLE.**   
  
This API is reliable and breaking changes are unlikely.

qlik.app.createGenericObject(param, callback)

Creates a generic object and registers a callback to receive the data. The generic object can contain the following:

* qHyperCubeDef
* qListObjectDef
* qStringExpression
* qValueExpression

The callback method is called whenever the selection state changes in a way that affects the generic object. The parameter is the evaluated version of the definition.

## Version history

Version history

| Version state | Details |
| --- | --- |
| Introduced | 1.0 |

## Parameters

### param

Type: Object

Generic object definition.

### callback

Type: Function

Optional.

Callback method. Registers a callback that is executed every time data is returned.

## Returns

A promise of an object model.

Tip noteFor more information regarding a promise, see [The Promise API](https://code.angularjs.org/1.5.8/docs/api/ng/service/$q#the-promise-api).

## Example

```
app.createGenericObject( {
	user: {
		qStringExpression: "=QVUser ()"
	},
	version : {
		qStringExpression: "=QlikViewVersion ()"
	},
	fields: {
		qValueExpression: "=Count (DISTINCT $Field)"
	}
}, function ( reply ) {
	var str = "Version:" + reply.version + " Fields:" + reply.fields;
	if ( reply.user ) {
		str += " User:" + reply.user;
	}
	$( "#info" ).html(str);
});
```

## Learn more

* [Generic object](https://help.qlik.com/en-US/sense-developer/May2025/Subsystems/EngineAPI/Content/Sense_EngineAPI/GenericObject/overview-generic-object.htm)