# create method

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

qlik.app.variable.create(qProp)

Creates a variable.

Information noteA new implementation of the create method was introduced in version 2.1. The legacy implementation of the method will continue to work but it is recommended to use the new implementation.

## Version history

Version history

| Version state | Details |
| --- | --- |
| Introduced | 1.0 |
| Updated | 2.1 |

## Parameters

### qProp

Type: String | Object

Variable name or properties. Properties:

qProp object properties

| Name | Type | Description |
| --- | --- | --- |
| qInfo.qId | String | Optional.<br><br>Variable id.<br><br>If the selected ID is already in use, a new ID is automatically set by the engine. |
| qName | String | Variable name.<br><br>The name must be unique. |
| qComment | String | Optional.<br><br>Comment related to the variable. |
| qDefinition | String | Optional.<br><br>Variable definition. |
| qNumberPresentation | Object | Optional.<br><br>Defines the format of the value. |
| qIncludeInBookmark | Boolean | Optional.<br><br>Set to true to update the variable when applying a bookmark. The variable value will be persisted in the bookmark. |

## Returns

Returns a promise of a variable 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).

## Examples

Example: Current implementation - object

```
var app = qlik.openApp('c31e2aba-3b46-4b13-8b87-c5c2514dea1d', config);
	app.variable.create({qName : 'myvar', qDefinition: 'Month'});
```

app.variable.create parameter description

| Name | Type | Description |
| --- | --- | --- |
| Name | String |  |