QIX

v12.1143.0

The JSON-RPC API over websocket that enables you to interact with the Qlik Associative Engine.

The QIX API is the primary API used for working with Qlik apps. It's based on the WebSocket protocol and requires some specific parameters to work correctly as seen below.

WebSockets

When you want to use the API, any websocket client implementation that follows the RFC specification should be supported. The URL format is:

wss://your-tenant.us.qlikcloud.com/app/<app id>

Browser example:

const websocket = new WebSocket('wss://your-tenant.us.qlikcloud.com/app/123e4567-e89b-12d3-a456-426655440000');

Headers

In a non-browser environment, most websocket client implementations support to add headers.

Use header Authorization: Bearer <token> with API key for authentication.

Session sharing

When using the QIX API you build up a state in what's called a session. A session is based on a tenant, a user, and the app. When opening a new websocket you'd either get a new unique session, or get attached to an existing session. When sharing a session, the state (like selections), is shared between all websocket connections.

The conditions for sharing a session is:

  • The websocket URL needs to be identical (tenant URL and app id)
  • The user needs to be the same:
    • in a browser environment the same user needs to be signed in
    • in a non-browser environment an API key from the same user and tenant needs to be used

JSON-RPC protocol

The QIX API leverages the JSON-RPC protocol. It implements a superset of this specification. All requests sent from the client should contain the following properties:

{
  // Protocol descriptor:
  "jsonrpc": "2.0",
  // Session-unique numeric id, referred to in the response
  // to connect the request and response:
  "id": 6,
  // The handle for the object to interact with:
  "handle": 2,
  // The object type of the handle above decides
  // which API methods you may invoke:
  "method": "ApiMethodName",
  // Parameters for the invoked API method:
  "params": {
  }
}

Request and response

Here is an example request/response pair. Note that there is only one static handle in the QIX API, and that's -1. This handle refers to the Global API.

In this example request, an app is opened using OpenDoc. If successful, the response contains a reference to the app handle, which can be used to do further requests towards the Doc (app) API, and so forth.

{
  "jsonrpc": "2.0",
  "id": 1,
  "handle": -1,
  "method": "OpenDoc",
  "params": {
    "qDocName": "<app id>"
  }
}

If that app exist, the response would look similar to this:

{
    "jsonrpc": "2.0",
    "id": 1,
    "result": {
      "qReturn": {
        "qType": "Doc",
        "qHandle": 1,
        "qGenericId": "<app id>"
      }
    },
    "change":[1]
}

Note that qHandle contains the handle that might be used to make additional requests to invoke API methods towards the app. A property called change is also received on the response, an array that can be sent by QIX Engine on any responses and contains all open handles in your session that may have been invalidated and you should refetch data to ensure your application in a valid state.

Session apps

Session apps are non-persisted Qlik Sense apps created on-the-fly in server memory by the Qlik Associative Engine. You have to define a load script and trigger a data reload before any data model is accessible for each user session. Similarly, if you create a session app from an existing app, you have to trigger a reload after retrieving objects from the template app.

Session apps are attached to the active Qlik Associative Engine session. When a session ends, for example, by the user logging out, the session app is terminated and all related resources are released from server memory. Standard Qlik security rules ensure that only authenticated users can access data and visualizations from a session app.

WebSocket URL for session apps

The WebSocket URL for creating a session app has the following format:

wss://my-tenant.us.qlikcloud.com/app/SessionApp_{appId}

You must append a unique app ID to SessionApp_ in the path. The app ID can be a code-generated random number.

To create a session app from an app, you must add the template app ID as a query parameter to the URL:

wss://my-tenant.us.qlikcloud.com/app/SessionApp_{appId}?from={templateAppId}

API references

For the API references, see the different classes listed in the left-side menu.

Doc

DocAbortModal(qAccept)

Aborts any selection mode in an app. For more information about selection mode, see BeginSelections method.

Parameters

qAccept
boolean

Set this parameter to true to accept the selections before exiting the selection mode.

Returns

Results for Doc.AbortModal
object

No description

Errors

No description

const result = await doc.abortModal({
  "qAccept": true
});
// console.log(result);
undefined

DocAddAlternateState(qStateName)

Adds an alternate state in the app. You can create multiple states within a Qlik Sense app and apply these states to specific objects within the app. Objects in a given state are not affected by user selections in the other states.

Parameters

qStateName
string

Name of the alternate state.

Returns

Results for Doc.AddAlternateState
object

No description

Errors

No description

const result = await doc.addAlternateState({
  "qStateName": "value"
});
// console.log(result);
undefined

DocAddFieldFromExpression(qName, qExpr)

Adds a field on the fly.

The expression of a field on the fly is persisted but not its values.
The operation is successful if **qSuccess** is set to true.

Parameters

qName
string

Name of the field.

qExpr
string

Expression value. It is not possible to use all aggregation functions. For example, you cannot add a field on the fly with an expression that uses the Sum or Count aggregation functions.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.addFieldFromExpression({
  "qName": "value",
  "qExpr": "value"
});
// console.log(result);
true

DocAddSessionAlternateState(qStateName, qSourceStateName?)

Adds an session alternate state in the app. You can create multiple states within a Qlik Sense app and apply these states to specific objects within the app. Objects in a given state are not affected by user selections in the other states. A session alternate state is not persisted and is not included in the StateNames array in the AppLayout. You can use the optional second parameter to choose any other state to get the initial selection on the new state from

Parameters

qStateName
string

Name of the alternate state.

qSourceStateName
optional
string

Name of existing state to copy the initial selections from

Returns

Results for Doc.AddSessionAlternateState
object

No description

Errors

No description

const result = await doc.addSessionAlternateState({
  "qStateName": "value",
  "qSourceStateName": "value"
});
// console.log(result);
undefined

DocApplyBookmark(qId)

Applies a bookmark.

The operation is successful if **qSuccess** is set to true.

Parameters

qId
string

Identifier of the bookmark.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.applyBookmark({
  "qId": "value"
});
// console.log(result);
true

DocBack()

Loads the last logical operation (if any).

Returns

Results for Doc.Back
object

No description

Errors

No description

const result = await doc.back({});
// console.log(result);
undefined

DocBackCount()

Returns the number of entries on the back stack.

Returns

qReturn
integer

No description

Errors

No description

const result = await doc.backCount({});
// console.log(result);
1

DocChangeSessionAppOwner(qNewOwnerId)

experimental

Change the owner of a session app.

Can be used by a privileged user when creating a session app to be consumed by another user. Only useful in environments where it is possible to reconnect to a session app, currently only in cloud deployments.

Parameters

qNewOwnerId
string

Identifier of the new app owner.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.changeSessionAppOwner({
  "qNewOwnerId": "value"
});
// console.log(result);
true

DocChangeSessionAppSpace(qSpaceId)

experimental

Add a session app to a space.

Can be used by a privileged user when creating a session app to be consumed by other users. Only useful in environments where it is possible to reconnect to a session app, currently only in cloud deployments.

Parameters

qSpaceId
string

Identifier of the new space.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.changeSessionAppSpace({
  "qSpaceId": "value"
});
// console.log(result);
true

DocCheckExpression(qExpr, qLabels?)

Checks if a given expression is valid.

The expression is correct if the parameters _qErrorMsg_ , _qBadFieldNames_ and _qDangerousFieldNames_ are empty.

Parameters

qExpr
string

Expression to check.

qLabels
optional
Array<string>

List of labels.

Returns

Results for Doc.CheckExpression

No description

Errors

No description

const result = await doc.checkExpression({
  "qExpr": "value",
  "qLabels": [
    "value"
  ]
});
// console.log(result);
"value"

DocCheckNumberOrExpression(qExpr)

Checks if:

  • A given expression is valid.
  • A number is correct according to the locale.

Parameters

qExpr
string

Expression to check.

Returns

Results for Doc.CheckNumberOrExpression

No description

Errors

No description

const result = await doc.checkNumberOrExpression({
  "qExpr": "value"
});
// console.log(result);
"value"

DocCheckScriptSyntax()

Checks the syntax of a script.

Example

"result": { "qErrors": [ { "qErrLen": 3, "qTabIx": 0, "qLineInTab": 0, "qColInLine": 0, "qTextPos": 0 }, { "qErrLen": 5, "qTabIx": 0, "qLineInTab": 0, "qColInLine": 1, "qTextPos": 4, "qSecondaryFailure": true } ] }

The first area is the primary error area, the second area is the secondary error area. The second area is optional and is shown only if qSecondaryFailure is set to true. The second area ends when the next statement in the script begins.
The list of syntax errors in the script. If there are no errors, the engine returns: If there are errors, the engine returns the following properties in the response:
NameDescriptionType
qErrLenLength of the word where the error is located.Integer
qTabIxNumber of the faulty section.Integer
qLineInTabLine number in the section where the error is located.Integer
qColInLinePosition of the erroneous text from the beginning of the line.Integer
qTextPosPosition of the erroneous text from the beginning of the script.Integer
qSecondaryFailureThe default value is false.Boolean

Returns

qErrors

No description

Errors

No description

const result = await doc.checkScriptSyntax({});
// console.log(result);
[
  {
    "qErrLen": 1,
    "qTabIx": 1,
    "qLineInTab": 1,
    "qColInLine": 1,
    "qTextPos": 1,
    "qSecondaryFailure": true
  }
]

DocClearAll(qLockedAlso?, qStateName?)

Clear selections in fields for current state. Locked fields are not cleared by default.

Parameters

qLockedAlso
optional
boolean

When true, clears the selection for locked fields.

qStateName
optional
string

Alternate state name. When set, applies to alternate state instead of current

Returns

Results for Doc.ClearAll
object

No description

Errors

No description

const result = await doc.clearAll({
  "qLockedAlso": true,
  "qStateName": "value"
});
// console.log(result);
undefined

DocClearUndoBuffer()

Clears entirely the undo and redo buffer.

Returns

Results for Doc.ClearUndoBuffer
object

No description

Errors

No description

const result = await doc.clearUndoBuffer({});
// console.log(result);
undefined

DocCloneBookmark(qId)

Clones a bookmark.

The identifier is set by the engine.

Parameters

qId
string

Identifier of the object to clone.

Returns

qCloneId
string

No description

Errors

No description

const result = await doc.cloneBookmark({
  "qId": "value"
});
// console.log(result);
"value"

DocCloneDimension(qId)

Clones a dimension.

The identifier is set by the engine.

Parameters

qId
string

Identifier of the object to clone.

Returns

qCloneId
string

No description

Errors

No description

const result = await doc.cloneDimension({
  "qId": "value"
});
// console.log(result);
"value"

DocCloneMeasure(qId)

Clones a measure.

The identifier is set by the engine.

Parameters

qId
string

Identifier of the object to clone.

Returns

qCloneId
string

No description

Errors

No description

const result = await doc.cloneMeasure({
  "qId": "value"
});
// console.log(result);
"value"

DocCloneObject(qId)

Clones root level objects, such as sheets and stories. The CloneObject works for both app objects and child objects. When you clone an object that contains children, the children are cloned as well. If you for example want to clone a visualization, you must provide the qID of the root object, in this case the sheet since CloneObject clones root level objects.

It is not possible to clone a session object.
The identifier is set by the engine.

Parameters

qId
string

Identifier of the object to clone. The identifier must be a root object.

Returns

qCloneId
string

No description

Errors

No description

const result = await doc.cloneObject({
  "qId": "value"
});
// console.log(result);
"value"

DocCommitDraft(qId)

deprecated

Commits the draft of an object that was previously created by invoking the CreateDraft. Committing a draft replaces the corresponding published object.

Parameters

qId
string

Identifier of the draft to commit.

Returns

Results for Doc.CommitDraft
object

No description

Errors

No description

const result = await doc.commitDraft({
  "qId": "value"
});
// console.log(result);
undefined

DocCreateBookmark(qProp)

Creates a bookmark.

Parameters

qProp

Properties for the object.

Returns

Results for Doc.CreateBookmark

No description

Errors

No description

const result = await doc.createBookmark({
  "qProp": {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qMetaDef": {}
  }
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocCreateBookmarkEx(qProp, qObjectIdsToPatch?)

experimental

Creates a bookmark with softpatches.

Parameters

qProp

Properties for the object.

qObjectIdsToPatch
optional
Array<string>

Add softpatches for this objects if available. If empty all softpatches are added to the bookmark.

Returns

Results for Doc.CreateBookmarkEx

No description

Errors

No description

const result = await doc.createBookmarkEx({
  "qProp": {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qMetaDef": {}
  },
  "qObjectIdsToPatch": [
    "value"
  ]
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocCreateConnection(qConnection)

Creates a connection. A connection indicates from which data source the data should be taken.

Parameters

qConnection

Information about the connection.

Returns

qConnectionId
string

No description

Errors

No description

const result = await doc.createConnection({
  "qConnection": {
    "qId": "value",
    "qName": "value",
    "qConnectionString": "value",
    "qType": "value",
    "qUserName": "value",
    "qPassword": "value",
    "qModifiedDate": "value",
    "qMeta": {
      "qName": "value"
    },
    "qLogOn": "value"
  }
});
// console.log(result);
"value"

DocCreateDimension(qProp)

Creates a master dimension. A master dimension is stored in the library of an app and can be used in many objects. Several generic objects can contain the same dimension.

Parameters

qProp

Information about the properties.

Returns

Results for Doc.CreateDimension

No description

Errors

No description

const result = await doc.createDimension({
  "qProp": {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qDim": {
      "qGrouping": "value",
      "qFieldDefs": [
        "value"
      ],
      "qFieldLabels": [
        "value"
      ],
      "qLabelExpression": "value"
    },
    "qMetaDef": {}
  }
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocCreateDraft(qId)

deprecated

Creates a draft of an object. This method can be used to create a draft of a sheet or a story that is published. This is a way to continue working on a sheet or a story that is published. Replace the published object by the content of the draft by invoking the CommitDraft.

The identifier is set by the engine.

Parameters

qId
string

Identifier of the object to create a draft from.

Returns

qDraftId
string

No description

Errors

No description

const result = await doc.createDraft({
  "qId": "value"
});
// console.log(result);
"value"

DocCreateMeasure(qProp)

Creates a master measure. A master measure is stored in the library of an app and can be used in many objects. Several generic objects can contain the same measure.

Parameters

qProp

Information about the properties.

Returns

Results for Doc.CreateMeasure

No description

Errors

No description

const result = await doc.createMeasure({
  "qProp": {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qMeasure": {
      "qLabel": "value",
      "qDef": "value",
      "qGrouping": "value",
      "qExpressions": [
        "value"
      ],
      "qActiveExpression": 1,
      "qLabelExpression": "value",
      "qNumFormat": {
        "qType": "value",
        "qnDec": 1,
        "qUseThou": 1,
        "qFmt": "value",
        "qDec": "value",
        "qThou": "value"
      }
    },
    "qMetaDef": {}
  }
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocCreateObject(qProp)

Creates a generic object at app level. For more information on generic objects, see Generic object. It is possible to create a generic object that is linked to another object. A linked object is an object that points to a linking object. The linking object is defined in the properties of the linked object (in qExtendsId ). The linked object has the same properties as the linking object.

The linking object cannot be a transient object.

Parameters

qProp

Information about the object.

Returns

Results for Doc.CreateObject

No description

Errors

No description

const result = await doc.createObject({
  "qProp": {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qExtendsId": "value",
    "qMetaDef": {},
    "qStateName": "value"
  }
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocCreateSessionObject(qProp)

Creates a transient object. For example, you can use a transient object to create an app overview or a story overview. It is possible to create a transient object that is linked to another object. A linked object is an object that points to a linking object. The linking object is defined in the properties of the linked object (in qExtendsId ). The linked object has the same properties as the linking object.

The linking object cannot be a transient object.

Parameters

qProp

Information about the object.

Returns

qReturn

No description

Errors

No description

const result = await doc.createSessionObject({
  "qProp": {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qExtendsId": "value",
    "qMetaDef": {},
    "qStateName": "value"
  }
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocCreateSessionVariable(qProp)

Creates a transient variable.

To set some properties to the variable, use the _SetProperties method_.

Definition

A variable in Qlik Sense is a named entity, containing a data value. This value can be static or be the result of a calculation. A variable acquires its value at the same time that the variable is created or after when updating the properties of the variable. Variables can be used in bookmarks and can contain numeric or alphanumeric data. Any change made to the variable is applied everywhere the variable is used. When a variable is used in an expression, it is substituted by its value or the variable's definition.

Example

The variable x contains the text string Sum(Sales) . In a chart, you define the expression $(x)/12 . The effect is exactly the same as having the chart expression Sum(Sales)/12 . However, if you change the value of the variable x to Sum(Budget) , the data in the chart are immediately recalculated with the expression interpreted as Sum(Budget)/12 .

Parameters

qProp

Name of the variable. Variable names are case sensitive.

Returns

qReturn

No description

Errors

No description

const result = await doc.createSessionVariable({
  "qProp": {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qMetaDef": {},
    "qName": "value",
    "qComment": "value",
    "qNumberPresentation": {
      "qType": "value",
      "qnDec": 1,
      "qUseThou": 1,
      "qFmt": "value",
      "qDec": "value",
      "qThou": "value"
    },
    "qIncludeInBookmark": true,
    "qDefinition": "value"
  }
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocCreateVariable(qName)

deprecatedUse Doc::CreateVariableEx method instead

Creates a variable.

Parameters

qName
string

Name of the variable. Variable names are case sensitive.

Returns

qReturn
boolean

No description

Errors

No description

const result = await doc.createVariable({
  "qName": "value"
});
// console.log(result);
true

DocCreateVariableEx(qProp)

Creates a variable. To create a variable via a script, you need to use the SetScript. For more information, see Create a variable.

To set some properties to the variable, use the _SetProperties method_.
In a published app, only transient variables can be created. See CreateSessionVariable.

Definition

A variable in Qlik Sense is a named entity, containing a data value. This value can be static or be the result of a calculation. A variable acquires its value at the same time that the variable is created or after when updating the properties of the variable. Variables can be used in bookmarks and can contain numeric or alphanumeric data. Any change made to the variable is applied everywhere the variable is used. When a variable is used in an expression, it is substituted by its value or the variable's definition.

Example

The variable x contains the text string Sum(Sales) . In a chart, you define the expression $(x)/12 . The effect is exactly the same as having the chart expression Sum(Sales)/12 . However, if you change the value of the variable x to Sum(Budget) , the data in the chart are immediately recalculated with the expression interpreted as Sum(Budget)/12 .

Parameters

qProp

Name of the variable. Variable names are case sensitive and must be unique.

Returns

Results for Doc.CreateVariableEx

No description

Errors

No description

const result = await doc.createVariableEx({
  "qProp": {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qMetaDef": {},
    "qName": "value",
    "qComment": "value",
    "qNumberPresentation": {
      "qType": "value",
      "qnDec": 1,
      "qUseThou": 1,
      "qFmt": "value",
      "qDec": "value",
      "qThou": "value"
    },
    "qIncludeInBookmark": true,
    "qDefinition": "value"
  }
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocDeleteConnection(qConnectionId)

Deletes a connection.

In Qlik Sense Enterprise, there is an additional file connection named _AttachedFiles_ . The AttachedFiles connection can only be removed by the administrator of the system.

Parameters

qConnectionId
string

Identifier of the connection to remove.

Returns

Results for Doc.DeleteConnection
object

No description

Errors

No description

const result = await doc.deleteConnection({
  "qConnectionId": "value"
});
// console.log(result);
undefined

DocDestroyBookmark(qId)

Removes a bookmark.

The operation is successful if **qSuccess** is set to true.

Parameters

qId
string

Identifier of the bookmark.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.destroyBookmark({
  "qId": "value"
});
// console.log(result);
true

DocDestroyDimension(qId)

Removes a dimension.

The operation is successful if **qSuccess** is set to true.

Parameters

qId
string

Identifier of the dimension to remove.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.destroyDimension({
  "qId": "value"
});
// console.log(result);
true

DocDestroyDraft(qId, qSourceId)

deprecated

Removes the draft of an object. The children of the draft object (if any) are removed as well. This method can be used to cancel the work on the draft of an object. For example, if you had created a draft of a sheet that is published, you might not want anymore to replace the published sheet.

The operation is successful if **qSuccess** is set to true.

Parameters

qId
string

Identifier of the draft object to remove.

qSourceId
string

Identifier of the source object (the object from which a draft was created).

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.destroyDraft({
  "qId": "value",
  "qSourceId": "value"
});
// console.log(result);
true

DocDestroyMeasure(qId)

Removes a generic measure.

The operation is successful if **qSuccess** is set to true.

Parameters

qId
string

Identifier of the measure to remove.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.destroyMeasure({
  "qId": "value"
});
// console.log(result);
true

DocDestroyObject(qId)

Removes an app object. The children of the object (if any) are removed as well.

The operation is successful if **qSuccess** is set to true.

Parameters

qId
string

Identifier of the object to remove.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.destroyObject({
  "qId": "value"
});
// console.log(result);
true

DocDestroySessionObject(qId)

Removes a transient object.

The operation is successful if **qSuccess** is set to true.

Parameters

qId
string

Identifier of the transient object to remove.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.destroySessionObject({
  "qId": "value"
});
// console.log(result);
true

DocDestroySessionVariable(qId)

Removes a transient variable.

The operation is successful if **qSuccess** is set to true.

Parameters

qId
string

Identifier of the variable.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.destroySessionVariable({
  "qId": "value"
});
// console.log(result);
true

DocDestroySessionVariableById(qId)

Removes a transient variable.

**qSuccess** is set to true if the operation is successful.

Parameters

qId
string

Identifier of the variable.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.destroySessionVariableById({
  "qId": "value"
});
// console.log(result);
true

DocDestroySessionVariableByName(qName)

Removes a transient variable.

**qSuccess** is set to true if the operation is successful.

Parameters

qName
string

Name of the variable.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.destroySessionVariableByName({
  "qName": "value"
});
// console.log(result);
true

DocDestroyVariableById(qId)

Removes a variable. Script-defined variables cannot be removed using the DestroyVariableById or the DestroyVariableByName. For more information, see Remove a variable.

The operation is successful if **qSuccess** is set to true.

Parameters

qId
string

Identifier of the variable.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.destroyVariableById({
  "qId": "value"
});
// console.log(result);
true

DocDestroyVariableByName(qName)

Removes a variable. Script-defined variables cannot be removed using the DestroyVariableById or the DestroyVariableByName. For more information, see Remove a variable.

The operation is successful if **qSuccess** is set to true.

Parameters

qName
string

Name of the variable.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.destroyVariableByName({
  "qName": "value"
});
// console.log(result);
true

DocDoReload(qMode?, qPartial?, qDebug?)

Reloads the script that is set in an app.

Logs

When this method is called, audit activity logs are produced to track the user activity. In the case of errors, both audit activity logs and system services logs are produced. The log files are named as follows:

Audit activity logSystem service log
<MachineName>_AuditActivity_Engine.txt in Qlik Sense Enterprise
<MachineName>_AuditActivity_Engine.log in Qlik Sense Desktop
<MachineName>_Service_Engine.txt in Qlik Sense Enterprise
<MachineName>_Service_Engine.log in Qlik Sense Desktop

Where to find the log files

The location of the log files depends on whether you have installed Qlik Sense Enterprise or Qlik Sense Desktop.

Qlik Sense Enterprise Qlik Sense Desktop
%ProgramData%/Qlik/Sense/Log/Engine%UserProfile%/Documents/Qlik/Sense/Log

Parameters

qMode
optional
integer

Error handling mode One of:

  • 0: for default mode.
  • 1: for ABEND; the reload of the script ends if an error occurs.
  • 2: for ignore; the reload of the script continues even if an error is detected in the script.
qPartial
optional
boolean

Set to true for partial reload. The default value is false.

qDebug
optional
boolean

Set to true if debug breakpoints are to be honored. The execution of the script will be in debug mode. The default value is false.

Returns

qReturn
boolean

No description

Errors

No description

const result = await doc.doReload({
  "qMode": 1,
  "qPartial": true,
  "qDebug": true
});
// console.log(result);
true

DocDoReloadEx(qParams?)

Reloads the script that is set in an app and returns the path to the script log file.

A log file is created per reload.

Logs

When this method is called, audit activity logs are produced to track the user activity. In the case of errors, both audit activity logs and system services logs are produced. The log files are named as follows:

Audit activity logSystem service log
< MachineName>AuditActivityEngine.txt in Qlik Sense Enterprise
< MachineName>AuditActivityEngine.log in Qlik Sense Desktop
< MachineName>ServiceEngine.txt in Qlik Sense Enterprise
< MachineName>ServiceEngine.log in Qlik Sense Desktop

Where to find the log files

The location of the log files depends on whether you have installed Qlik Sense Enterprise or Qlik Sense Desktop.

Qlik Sense Enterprise Qlik Sense Desktop
%ProgramData%/Qlik/Sense/Log/Engine%UserProfile%/Documents/Qlik/Sense/Log

DoReloadExParams

NameDescriptionType
qModeError handling mode
One of:
  • 0: for default mode.
  • 1: for ABEND; the reload of the script ends if an error occurs.
  • 2: for ignore; the reload of the script continues even if an error is detected in the script.
Integer
qPartialSet to true for partial reload.
The default value is false.
Boolean
qDebugSet to true if debug breakpoints are to be honored. The execution of the script will be in debug mode.
The default value is false.
Boolean

DoReloadExResult

NameDescriptionType
qSuccessThe operation is successful if qSuccess is set to True.Boolean
qScriptLogFilePath to the script log file.String

If the data load has successfully finished, no matter how the indexing behaves, true is returned. This happens even if there is a timeout, a memory limit is reached or any other error occurs during the indexing.

Parameters

qParams

No description

Returns

qResult

No description

Errors

No description

const result = await doc.doReloadEx({
  "qParams": {
    "qMode": 1,
    "qPartial": true,
    "qDebug": true,
    "qReloadId": "value"
  }
});
// console.log(result);
{
  "qSuccess": true,
  "qScriptLogFile": "value"
}

DocDoSave(qFileName?)

Saves an app. All objects and data in the data model are saved.

Parameters

qFileName
optional
string

Name of the file to save.

Returns

Results for Doc.DoSave
object

No description

Errors

No description

const result = await doc.doSave({
  "qFileName": "value"
});
// console.log(result);
undefined

DocEvaluate(qExpression)

Evaluates an expression and returns the result as a string.

Example

The client sends:

{
    "handle": 1,
    "method": "Evaluate",
    "params": {
        "qExpression": "Sum(Holes)"
    },
    "id": 6,
    "jsonrpc": "2.0"
}

The engine returns:

{
    "jsonrpc": "2.0",
    "id": 6,
    "result": {
        "qReturn": "361716"
    }
}

Parameters

qExpression
string

Expression to evaluate.

Returns

qReturn
string

No description

Errors

No description

const result = await doc.evaluate({
  "qExpression": "value"
});
// console.log(result);
"value"

DocEvaluateEx(qExpression)

Evaluates an expression and returns the result as a dual.

Example

The client sends:

{
    "handle": 1,
    "method": "EvaluateEx",
    "params": {
        "qExpression": "Sum(Holes)"
    },
    "id": 7,
    "jsonrpc": "2.0"
}

The engine returns:

{
    "jsonrpc": "2.0",
    "id": 7,
    "result": {
        "qReturn": "361716"
    }
}

Parameters

qExpression
string

Expression to evaluate.

Returns

qValue

No description

Errors

No description

const result = await doc.evaluateEx({
  "qExpression": "value"
});
// console.log(result);
{
  "qText": "value",
  "qIsNumeric": true,
  "qNumber": 1
}

DocExpandExpression(qExpression)

Expands the expression.

Parameters

qExpression
string

The expression string to expand.

Returns

qExpandedExpression
string

No description

Errors

No description

const result = await doc.expandExpression({
  "qExpression": "value"
});
// console.log(result);
"value"

DocExportReducedData(qOptions?)

Applies a bookmark to reduce (slice) the data on. Returns a url and file size to the reduced application. Section Access is always applied.

This API is only available on Sense Enterprise on Windows

Parameters

qOptions

BookmarkId used to reduced the app on and an expire time.

Returns

qDownloadInfo

No description

Errors

No description

const result = await doc.exportReducedData({
  "qOptions": {
    "qBookmarkId": "value",
    "qExpires": 1,
    "qServeOnce": true
  }
});
// console.log(result);
{
  "qUrl": "value",
  "qFileSize": 1
}

DocFindMatchingFields(qFieldName, qTags)

Retrieves any fields that belong to the same archipelago as the specified field and that match at least one of the specified tags.

Tags set by Qlik Sense are prefixed by the _$_ sign.

Parameters

qFieldName
string

Name of the field. This method looks for fields that belong to the same archipelago as this specified field.

qTags
Array<string>

List of tags. This method looks for fields that match at least one of the tags in this list.

Returns

qFieldNames

No description

Errors

No description

const result = await doc.findMatchingFields({
  "qFieldName": "value",
  "qTags": [
    "value"
  ]
});
// console.log(result);
[
  {
    "qName": "value",
    "qTags": [
      "value"
    ]
  }
]

DocForward()

Loads the next logical operation (if any).

Returns

Results for Doc.Forward
object

No description

Errors

No description

const result = await doc.forward({});
// console.log(result);
undefined

DocForwardCount()

Returns the number of entries on the Forward stack.

Returns

qReturn
integer

No description

Errors

No description

const result = await doc.forwardCount({});
// console.log(result);
1

DocGetAllInfos()

Returns the identifier and the type of any generic object in the app.

Returns

qInfos

No description

Errors

No description

const result = await doc.getAllInfos({});
// console.log(result);
[
  {
    "qId": "value",
    "qType": "value"
  }
]

DocGetAppLayout()

Evaluates an app. Returns dynamic properties (if any) in addition to the engine (fixed) properties. A data set is returned.

Returns

qLayout

No description

Errors

No description

const result = await doc.getAppLayout({});
// console.log(result);
{
  "qTitle": "value",
  "qFileName": "value",
  "qLastReloadTime": "value",
  "qModified": true,
  "qHasScript": true,
  "qStateNames": [
    "value"
  ],
  "qMeta": {
    "qName": "value"
  },
  "qLocaleInfo": {
    "qDecimalSep": "value",
    "qThousandSep": "value",
    "qListSep": "value",
    "qMoneyDecimalSep": "value",
    "qMoneyThousandSep": "value",
    "qCurrentYear": 1,
    "qMoneyFmt": "value",
    "qTimeFmt": "value",
    "qDateFmt": "value",
    "qTimestampFmt": "value",
    "qCalendarStrings": {
      "qDayNames": [
        "value"
      ],
      "qMonthNames": [
        "value"
      ],
      "qLongDayNames": [
        "value"
      ],
      "qLongMonthNames": [
        "value"
      ]
    },
    "qFirstWeekDay": 1,
    "qBrokenWeeks": true,
    "qReferenceDay": 1,
    "qFirstMonthOfYear": 1,
    "qCollation": "value",
    "qNumericalAbbreviation": "value"
  },
  "qHasData": true,
  "qReadOnly": true,
  "qIsOpenedWithoutData": true,
  "qIsSessionApp": true,
  "qThumbnail": {
    "qUrl": "value"
  },
  "qIsBDILiveMode": true
}

DocGetAppProperties()

Gets the properties of an app.

Returns

qProp

No description

Errors

No description

const result = await doc.getAppProperties({});
// console.log(result);
{
  "qTitle": "value",
  "qLastReloadTime": "value",
  "qMigrationHash": "value",
  "qSavedInProductVersion": "value",
  "qThumbnail": {
    "qUrl": "value"
  },
  "qHasSectionAccess": true
}

DocGetAssociationScores(qTable1, qTable2)

Computes a set of association scores for each pair of fields between two given tables that have been loaded in an app. When a table contains some synthetic keys, all fields in the synthetic key tables are analyzed against fields in other tables. To denote that a field is a synthetic key, the field name is prefixed by [Synthetic Key]: .

Parameters

qTable1
string

Name of the first table.

qTable2
string

Name of the second table.

Returns

qScore

No description

Errors

No description

const result = await doc.getAssociationScores({
  "qTable1": "value",
  "qTable2": "value"
});
// console.log(result);
[
  {
    "qFieldPairName": "value",
    "qScoreSummary": 1,
    "qField1Scores": {
      "qFieldName": "value",
      "qReadableName": "value",
      "qCardinalRatio": 1,
      "qSymbolScore": 1,
      "qRowScore": 1
    },
    "qField2Scores": {
      "qFieldName": "value",
      "qReadableName": "value",
      "qCardinalRatio": 1,
      "qSymbolScore": 1,
      "qRowScore": 1
    }
  }
]

DocGetBookmark(qId)

Returns the handle of a bookmark.

Parameters

qId
string

Identifier of the bookmark.

Returns

qReturn

No description

Errors

No description

const result = await doc.getBookmark({
  "qId": "value"
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocGetBookmarks(qOptions)

Returns all bookmarks compatible with options.

Parameters

qOptions

Bookmark type filter and requested properties.

Returns

qList

No description

Errors

No description

const result = await doc.getBookmarks({
  "qOptions": {
    "qTypes": [
      "value"
    ],
    "qData": {}
  }
});
// console.log(result);
[
  {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qMeta": {
      "qName": "value"
    },
    "qData": {}
  }
]

DocGetConnection(qConnectionId)

Retrieves a connection and returns:

  • The creation time of the connection.
  • The identifier of the connection.
  • The type of the connection.
  • The name of the connection.
  • The connection string.

Parameters

qConnectionId
string

Identifier of the connection.

Returns

qConnection

No description

Errors

No description

const result = await doc.getConnection({
  "qConnectionId": "value"
});
// console.log(result);
{
  "qId": "value",
  "qName": "value",
  "qConnectionString": "value",
  "qType": "value",
  "qUserName": "value",
  "qPassword": "value",
  "qModifiedDate": "value",
  "qMeta": {
    "qName": "value"
  },
  "qLogOn": "value"
}

DocGetConnections()

Lists the connections in an app.

In Qlik Sense Enterprise, there is an additional file connection named _AttachedFiles_ . This connection is stored in the Qlik Sense repository.

Returns

qConnections

No description

Errors

No description

const result = await doc.getConnections({});
// console.log(result);
[
  {
    "qId": "value",
    "qName": "value",
    "qConnectionString": "value",
    "qType": "value",
    "qUserName": "value",
    "qPassword": "value",
    "qModifiedDate": "value",
    "qMeta": {
      "qName": "value"
    },
    "qLogOn": "value"
  }
]

DocGetContentLibraries()

Lists the content libraries. To differentiate a global content library from an app specific content library, you can check the property qAppSpecific . If this property is set to true, it means that the content library is app specific.

There is always one specific content library per app.

Qlik Sense

Returns the global content libraries and the app specific content library. When using Qlik Sense, you can have more than one global content library. The global content libraries are common to all apps in the Qlik Sense repository. By default, there is one global content library named Default .

Qlik Sense Desktop

Returns the global content library and the app specific content library from the disk.

Returns

qList

No description

Errors

No description

const result = await doc.getContentLibraries({});
// console.log(result);
{
  "qItems": [
    {
      "qName": "value",
      "qAppSpecific": true,
      "qMeta": {
        "qName": "value"
      }
    }
  ]
}

DocGetDatabaseInfo(qConnectionId)

Gives information about an ODBC, OLEDB or CUSTOM connection. See Outputs for more details.

Parameters

qConnectionId
string

Name of the connection.

Returns

qInfo

No description

Errors

No description

const result = await doc.getDatabaseInfo({
  "qConnectionId": "value"
});
// console.log(result);
{
  "qDBMSName": "value",
  "qDBUsage": true,
  "qOwnerUsage": true,
  "qDBSeparator": "value",
  "qOwnerSeparator": "value",
  "qDBFirst": true,
  "qQuotePreffix": "value",
  "qQuoteSuffix": "value",
  "qSpecialChars": "value",
  "qDefaultDatabase": "value",
  "qKeywords": [
    "value"
  ]
}

DocGetDatabaseOwners(qConnectionId, qDatabase?)

Lists the owners of a database for a ODBC, OLEDB or CUSTOM connection.

Parameters

qConnectionId
string

Identifier of the connection.

qDatabase
optional
string

Name of the database.

Returns

qOwners

No description

Errors

No description

const result = await doc.getDatabaseOwners({
  "qConnectionId": "value",
  "qDatabase": "value"
});
// console.log(result);
[
  {
    "qName": "value"
  }
]

DocGetDatabaseTableFields(qConnectionId, qDatabase?, qOwner?, qTable)

Lists the fields inside a table of a database for a ODBC, OLEDB or CUSTOM connection.

Parameters

qConnectionId
string

Identifier of the connection.

qDatabase
optional
string

Name of the database. If qDatabase is not set then qOwner must be set.

qOwner
optional
string

Owner of the database. If qOwner is not set then qDatabase must be set.

qTable
string

Name of the table.

Returns

qFields

No description

Errors

No description

const result = await doc.getDatabaseTableFields({
  "qConnectionId": "value",
  "qDatabase": "value",
  "qOwner": "value",
  "qTable": "value"
});
// console.log(result);
[
  {
    "qName": "value",
    "qIsKey": true,
    "qOriginalFieldName": "value"
  }
]

DocGetDatabaseTablePreview(qConnectionId, qDatabase?, qOwner?, qTable, qConditions?)

Retrieves the values of the specified table of a database for a ODBC, OLEDB or CUSTOM connection.

Parameters

qConnectionId
string

Identifier of the connection.

qDatabase
optional
string

Name of the database. If qDatabase is not set then qOwner must be set.

qOwner
optional
string

Owner of the database. If qOwner is not set then qDatabase must be set.

qTable
string

Name of the table.

qConditions
optional

No description

Returns

Results for Doc.GetDatabaseTablePreview

No description

Errors

No description

const result = await doc.getDatabaseTablePreview({
  "qConnectionId": "value",
  "qDatabase": "value",
  "qOwner": "value",
  "qTable": "value",
  "qConditions": {
    "qType": "value",
    "qWherePredicate": "value"
  }
});
// console.log(result);
[
  {
    "qValues": [
      "value"
    ]
  }
]

DocGetDatabaseTables(qConnectionId, qDatabase?, qOwner?)

Lists the tables inside a database for a ODBC, OLEDB or CUSTOM connection.

Parameters

qConnectionId
string

Identifier of the connection.

qDatabase
optional
string

Name of the database. If qDatabase is not set then qOwner must be set.

qOwner
optional
string

Owner of the database. If qOwner is not set then qDatabase must be set.

Returns

qTables

No description

Errors

No description

const result = await doc.getDatabaseTables({
  "qConnectionId": "value",
  "qDatabase": "value",
  "qOwner": "value"
});
// console.log(result);
[
  {
    "qName": "value",
    "qType": "value"
  }
]

DocGetDatabases(qConnectionId)

Lists the databases inside a ODBC, OLEDB or CUSTOM data source.

Parameters

qConnectionId
string

Identifier of the connection.

Returns

qDatabases

No description

Errors

No description

const result = await doc.getDatabases({
  "qConnectionId": "value"
});
// console.log(result);
[
  {
    "qName": "value",
    "qIsDefault": true
  }
]

DocGetDimension(qId)

Returns the handle of a dimension.

Parameters

qId
string

Identifier of the dimension.

Returns

qReturn

No description

Errors

No description

const result = await doc.getDimension({
  "qId": "value"
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocGetEmptyScript(qLocalizedMainSection?)

Creates a script that contains one section. This section contains SET statements that give localized information from the regional settings of the computer.

The computer regional settings are retrieved when the engine starts.

Parameters

qLocalizedMainSection
optional
string

Name of the script section. The default value is Main .

Returns

qReturn
string

No description

Errors

No description

const result = await doc.getEmptyScript({
  "qLocalizedMainSection": "value"
});
// console.log(result);
"value"

DocGetFavoriteVariables()

Retrieves the variables that are tagged as favorite.

Returns

qNames
Array<>

No description

Errors

No description

const result = await doc.getFavoriteVariables({});
// console.log(result);
[
  "value"
]

DocGetField(qFieldName, qStateName?)

Returns a handle to a field.

Parameters

qFieldName
string

Name of the field.

qStateName
optional
string

Name of the alternate state. Default state is current selections.

Returns

qReturn

No description

Errors

No description

const result = await doc.getField({
  "qFieldName": "value",
  "qStateName": "value"
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocGetFieldAndColumnSamples(qFieldsOrColumnsWithWildcards, qMaxNumberOfValues, qRandSeed?)

Get sample values from either a column in a table or from a field. Supports wildcard matches in tables or field names:

  • '*' for zero or more characters.
  • '?' for one character.

Parameters

qFieldsOrColumnsWithWildcards

Pairs of table (optionally) and field names. Support wildcard matches.

qMaxNumberOfValues
integer

Max number of sample values returned. Depending on the column or field size the number of returned samples can be less than MaxNumberOfValues. If MaxNumberOfValues is negative all sample values are returned.

qRandSeed
optional
integer

Optional. Sets the random number seed. Should only be set for test purposes.

Returns

qResult

No description

Errors

No description

const result = await doc.getFieldAndColumnSamples({
  "qFieldsOrColumnsWithWildcards": [
    {
      "qFieldName": "value",
      "qTableName": "value"
    }
  ],
  "qMaxNumberOfValues": 1,
  "qRandSeed": 1
});
// console.log(result);
[
  {
    "qFieldOrColumn": {
      "qFieldName": "value",
      "qTableName": "value"
    },
    "qValues": [
      {
        "qText": "value",
        "qIsNumeric": true,
        "qNumber": 1
      }
    ]
  }
]

DocGetFieldDescription(qFieldName)

Returns the description of a field.

Parameters

qFieldName
string

Name of the field.

Returns

qReturn

No description

Errors

No description

const result = await doc.getFieldDescription({
  "qFieldName": "value"
});
// console.log(result);
{
  "qInternalNumber": 1,
  "qName": "value",
  "qSrcTables": [
    "value"
  ],
  "qIsSystem": true,
  "qIsHidden": true,
  "qIsSemantic": true,
  "qDistinctOnly": true,
  "qCardinal": 1,
  "qTotalCount": 1,
  "qPossibleCount_OBSOLETE": 1,
  "qHasInfo_OBSOLETE": true,
  "qIsLocked": true,
  "qAlwaysOneSelected": true,
  "qAndMode": true,
  "qIsNumeric": true,
  "qComment": "value",
  "qTags": [
    "value"
  ],
  "qIsDefinitionOnly": true,
  "qByteSize": 1
}

DocGetFieldOnTheFlyByName(qReadableName)

Find the field-on-the-fly by passing its readable name.

Parameters

qReadableName
string

Readable name of the field-on-the-fly.

Returns

qName
string

No description

Errors

No description

const result = await doc.getFieldOnTheFlyByName({
  "qReadableName": "value"
});
// console.log(result);
"value"

DocGetFileTableFields(qConnectionId, qRelativePath?, qDataFormat, qTable)

Lists the fields of a table for a folder connection.

FileType

Recognized file formats are:

  • CSV for Delimited
  • FIX for Fixed Record
  • DIF for Data Interchange Format
  • EXCEL_BIFF for Microsoft Excel (XLS)
  • EXCEL_OOXML for Microsoft Excel (XLSX)
  • HTML for HTML
  • QVD for QVD file
  • XML for XML
  • QVX for QVX file
  • JSON for JSON format
  • KML for KML file

Parameters

qConnectionId
string

Identifier of the connection.

qRelativePath
optional
string

Path of the connection file.

qDataFormat

Type of the file.

qTable
string

Name of the table. This parameter must be set for XLS , XLSX , _HTML  _ and XML files.

Returns

Results for Doc.GetFileTableFields

No description

Errors

No description

const result = await doc.getFileTableFields({
  "qConnectionId": "value",
  "qRelativePath": "value",
  "qDataFormat": {
    "qType": "value",
    "qLabel": "value",
    "qQuote": "value",
    "qComment": "value",
    "qDelimiter": {
      "qName": "value",
      "qScriptCode": "value",
      "qNumber": 1,
      "qIsMultiple": true
    },
    "qCodePage": 1,
    "qHeaderSize": 1,
    "qRecordSize": 1,
    "qTabSize": 1,
    "qIgnoreEOF": true,
    "qFixedWidthDelimiters": "value"
  },
  "qTable": "value"
});
// console.log(result);
[
  {
    "qName": "value",
    "qIsKey": true,
    "qOriginalFieldName": "value"
  }
]

DocGetFileTablePreview(qConnectionId, qRelativePath?, qDataFormat, qTable)

Lists the values in a table for a folder connection.

FileType

Recognized file formats are:

  • CSV for Delimited
  • FIX for Fixed Record
  • DIF for Data Interchange Format
  • EXCEL_BIFF for Microsoft Excel (XLS)
  • EXCEL_OOXML for Microsoft Excel (XLSX)
  • HTML for HTML
  • QVD for QVD file
  • XML for XML
  • QVX for QVX file
  • JSON for JSON format
  • KML for KML file

Parameters

qConnectionId
string

Identifier of the connection.

qRelativePath
optional
string

Path of the connection file.

qDataFormat

Type of the file.

qTable
string

Name of the table. This parameter must be set for XLS , XLSX , _HTML  _ and XML files.

Returns

Results for Doc.GetFileTablePreview

No description

Errors

No description

const result = await doc.getFileTablePreview({
  "qConnectionId": "value",
  "qRelativePath": "value",
  "qDataFormat": {
    "qType": "value",
    "qLabel": "value",
    "qQuote": "value",
    "qComment": "value",
    "qDelimiter": {
      "qName": "value",
      "qScriptCode": "value",
      "qNumber": 1,
      "qIsMultiple": true
    },
    "qCodePage": 1,
    "qHeaderSize": 1,
    "qRecordSize": 1,
    "qTabSize": 1,
    "qIgnoreEOF": true,
    "qFixedWidthDelimiters": "value"
  },
  "qTable": "value"
});
// console.log(result);
[
  {
    "qValues": [
      "value"
    ]
  }
]

DocGetFileTables(qConnectionId, qRelativePath?, qDataFormat)

Lists the tables for a folder connection.

FileType

Recognized file formats are:

  • CSV for Delimited
  • FIX for Fixed Record
  • DIF for Data Interchange Format
  • EXCEL_BIFF for Microsoft Excel (XLS)
  • EXCEL_OOXML for Microsoft Excel (XLSX)
  • HTML for HTML
  • QVD for QVD file
  • XML for XML
  • QVX for QVX file
  • JSON for JSON format
  • KML for KML file

Parameters

qConnectionId
string

Identifier of the connection.

qRelativePath
optional
string

Path of the connection file.

qDataFormat

Type of the file.

Returns

qTables

No description

Errors

No description

const result = await doc.getFileTables({
  "qConnectionId": "value",
  "qRelativePath": "value",
  "qDataFormat": {
    "qType": "value",
    "qLabel": "value",
    "qQuote": "value",
    "qComment": "value",
    "qDelimiter": {
      "qName": "value",
      "qScriptCode": "value",
      "qNumber": 1,
      "qIsMultiple": true
    },
    "qCodePage": 1,
    "qHeaderSize": 1,
    "qRecordSize": 1,
    "qTabSize": 1,
    "qIgnoreEOF": true,
    "qFixedWidthDelimiters": "value"
  }
});
// console.log(result);
[
  {
    "qName": "value",
    "qType": "value"
  }
]

DocGetFileTablesEx(qConnectionId, qRelativePath?, qDataFormat)

Lists the tables and fields of a JSON or XML file for a folder connection.

Parameters

qConnectionId
string

Identifier of the connection.

qRelativePath
optional
string

Path of the connection file.

qDataFormat

Type of the file.

Returns

qTables

No description

Errors

No description

const result = await doc.getFileTablesEx({
  "qConnectionId": "value",
  "qRelativePath": "value",
  "qDataFormat": {
    "qType": "value",
    "qLabel": "value",
    "qQuote": "value",
    "qComment": "value",
    "qDelimiter": {
      "qName": "value",
      "qScriptCode": "value",
      "qNumber": 1,
      "qIsMultiple": true
    },
    "qCodePage": 1,
    "qHeaderSize": 1,
    "qRecordSize": 1,
    "qTabSize": 1,
    "qIgnoreEOF": true,
    "qFixedWidthDelimiters": "value"
  }
});
// console.log(result);
[
  {
    "qName": "value",
    "qFields": [
      {
        "qName": "value",
        "qIsKey": true,
        "qOriginalFieldName": "value"
      }
    ],
    "qFormatSpec": "value"
  }
]

DocGetFolderItemsForConnection(qConnectionId, qRelativePath?)

Lists the items for a folder connection.

Parameters

qConnectionId
string

Identifier of the connection.

qRelativePath
optional
string

Relative path of the connection.

Returns

qFolderItems

No description

Errors

No description

const result = await doc.getFolderItemsForConnection({
  "qConnectionId": "value",
  "qRelativePath": "value"
});
// console.log(result);
[
  {
    "qName": "value",
    "qType": "value"
  }
]

DocGetIncludeFileContent(qPath)

Gets the content of a file.

Parameters

qPath
string

["lib://CONNECTION_NAME\&lt;the name of the file you want to use>.txt"] OR ["lib://Connection_Name\&lt;Folder under your connection>\&lt;the name of the file you want to use>.txt"] [ ] should be used when the first variable contains a lib reference.

Returns

qContent
string

No description

Errors

No description

const result = await doc.getIncludeFileContent({
  "qPath": "value"
});
// console.log(result);
"value"

DocGetLibraryContent(qName)

Returns the content of a library.

Global content library

In Qlik Sense Desktop, the content files are retrieved from: %userprofile%\Documents\Qlik\Sense\Content\Default In Qlik Sense Enterprise, the content files are retrieved from the Qlik Sense repository.

App specific content library

The embedded files are returned.

Parameters

qName
string

Name of the content library. It corresponds to the property qContentLibraryListItem/qName returned by the GetContentLibraries method.

Returns

qList

No description

Errors

No description

const result = await doc.getLibraryContent({
  "qName": "value"
});
// console.log(result);
{
  "qItems": [
    {
      "qUrlDef": "value",
      "qUrl": "value"
    }
  ]
}

DocGetLineage()

Gets the lineage information of the app. The lineage information includes the LOAD and STORE statements from the data load script associated with this app. An array of lineage information.

Returns

qLineage

No description

Errors

No description

const result = await doc.getLineage({});
// console.log(result);
[
  {
    "qDiscriminator": "value",
    "qStatement": "value"
  }
]

DocGetLocaleInfo()

Returns locale information.

Returns

qReturn

No description

Errors

No description

const result = await doc.getLocaleInfo({});
// console.log(result);
{
  "qDecimalSep": "value",
  "qThousandSep": "value",
  "qListSep": "value",
  "qMoneyDecimalSep": "value",
  "qMoneyThousandSep": "value",
  "qCurrentYear": 1,
  "qMoneyFmt": "value",
  "qTimeFmt": "value",
  "qDateFmt": "value",
  "qTimestampFmt": "value",
  "qCalendarStrings": {
    "qDayNames": [
      "value"
    ],
    "qMonthNames": [
      "value"
    ],
    "qLongDayNames": [
      "value"
    ],
    "qLongMonthNames": [
      "value"
    ]
  },
  "qFirstWeekDay": 1,
  "qBrokenWeeks": true,
  "qReferenceDay": 1,
  "qFirstMonthOfYear": 1,
  "qCollation": "value",
  "qNumericalAbbreviation": "value"
}

DocGetLooselyCoupledVector()

Returns a list of table states.

The following states apply:

  • 0 The table is not loosely coupled.
  • 1 The table is loosely coupled.
  • 2 The table is loosely coupled and cannot be changed to another state using the Qlik Engine API.
The last three values in the vector are for internal use.
In case of circular references, the engine automatically sets the table state to loosely coupled to avoid creating loops.

Returns

qv
Array<>

No description

Errors

No description

const result = await doc.getLooselyCoupledVector({});
// console.log(result);
[
  1
]

DocGetMatchingFields(qTags, qMatchingFieldMode?)

Retrieves any fields that match all of the specified tags or just one of them in the data model of an app.

Tags set by Qlik Sense are prefixed by the _$_ sign.

Parameters

qTags
Array<string>

List of tags. The GetMatchingFields method looks for fields that match one or all of the tags in this list, depending on the value of qMatchingFieldMode .

qMatchingFieldMode
optional
string

Matching field mode. The default value is MATCHINGFIELDMODE_MATCH_ALL.

One of:

  • MATCHINGFIELDMODE_MATCH_ALL
  • MATCHINGFIELDMODE_MATCH_ONE

Returns

qFieldNames

No description

Errors

No description

const result = await doc.getMatchingFields({
  "qTags": [
    "value"
  ],
  "qMatchingFieldMode": "value"
});
// console.log(result);
[
  {
    "qName": "value",
    "qTags": [
      "value"
    ]
  }
]

DocGetMeasure(qId)

Returns the handle of a measure.

Parameters

qId
string

Identifier of the measure.

Returns

qReturn

No description

Errors

No description

const result = await doc.getMeasure({
  "qId": "value"
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocGetMeasureWithLabel(qLabel)

Returns the handle of a measure with a label. If multiple measures has the same label the first is returned.

Parameters

qLabel
string

is the label of the measure to be returned.

Returns

qReturn

No description

Errors

No description

const result = await doc.getMeasureWithLabel({
  "qLabel": "value"
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocGetMediaList()

deprecatedUse GetLibraryContent method instead

Lists the media files.

Returns

Results for Doc.GetMediaList

No description

Errors

No description

const result = await doc.getMediaList({});
// console.log(result);
true

DocGetObject(qId)

Returns the type of the app object and the corresponding handle.

Parameters

qId
string

Identifier of the object to retrieve.

Returns

qReturn

No description

Errors

No description

const result = await doc.getObject({
  "qId": "value"
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocGetObjects(qOptions)

Returns all objects compatible with options.

Parameters

qOptions

Object type filter and requested properties.

Returns

qList

No description

Errors

No description

const result = await doc.getObjects({
  "qOptions": {
    "qTypes": [
      "value"
    ],
    "qIncludeSessionObjects": true,
    "qData": {}
  }
});
// console.log(result);
[
  {
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qMeta": {
      "qName": "value"
    },
    "qData": {}
  }
]

DocGetScript()

Gets values in script.

Returns

qScript
string

No description

Errors

No description

const result = await doc.getScript({});
// console.log(result);
"value"

DocGetScriptBreakpoints()

Lists the breakpoints in the script of an app.

Returns

qBreakpoints

No description

Errors

No description

const result = await doc.getScriptBreakpoints({});
// console.log(result);
[
  {
    "qbufferName": "value",
    "qlineIx": 1,
    "qEnabled": true
  }
]

DocGetScriptEx()

Gets script and script meta-data.

Returns

qScript

No description

Errors

No description

const result = await doc.getScriptEx({});
// console.log(result);
{
  "qScript": "value",
  "qMeta": {
    "qName": "value"
  }
}

DocGetSetAnalysis(qStateName?, qBookmarkId?)

Returns a set analysis expression from active selections or from a saved bookmark. Fields on the fly and Calculated dimensions will not be included in the generated expressions, instead a message indicating 'missing fields' will provided within the expression.

BookmarkId emptyBookmarkId set
StateName empty (or $)Default selections state is returned.Default state ($) in bookmark with id is returned.
StateName setState selections is returned.State in bookmark with id is returned.

Parameters

qStateName
optional
string

Optional. The name of the state to get set analysis expression for. If left empty, the default state will be retrieved.

qBookmarkId
optional
string

Optional. The Id of the bookmark to get the set analysis expression for. If left empty, the current selection will be retrieved.

Returns

qSetExpression
string

No description

Errors

No description

const result = await doc.getSetAnalysis({
  "qStateName": "value",
  "qBookmarkId": "value"
});
// console.log(result);
"value"

DocGetTableData(qOffset, qRows, qSyntheticMode, qTableName)

Retrieves the data of a specific table.

Parameters

qOffset
integer

Position from the top, starting from 0. If the offset is set to 0, the rows starting from the position/index 0 are shown.

qRows
integer

Number of rows to show.

qSyntheticMode
boolean

If this parameter is set to true, the internal data/table representation is shown. Synthetic fields are present (if any).

qTableName
string

Name of the table.

Returns

qData

No description

Errors

No description

const result = await doc.getTableData({
  "qOffset": 1,
  "qRows": 1,
  "qSyntheticMode": true,
  "qTableName": "value"
});
// console.log(result);
[
  {
    "qValue": [
      {
        "qText": "value",
        "qIsNumeric": true,
        "qNumber": 1
      }
    ]
  }
]

DocGetTableProfileData(qTableName)

experimental

Returns profile data for a given table.

Parameters

qTableName
string

Name of the table

Returns

qProfiling

No description

Errors

No description

const result = await doc.getTableProfileData({
  "qTableName": "value"
});
// console.log(result);
{
  "qNoOfRows": 1,
  "qFieldProfiling": [
    {
      "qName": "value",
      "qFieldTags": [
        "value"
      ],
      "qNumberFormat": {
        "qType": "value",
        "qnDec": 1,
        "qUseThou": 1,
        "qFmt": "value",
        "qDec": "value",
        "qThou": "value"
      },
      "qDistinctValues": 1,
      "qDistinctNumericValues": 1,
      "qDistinctTextValues": 1,
      "qNumericValues": 1,
      "qNullValues": 1,
      "qTextValues": 1,
      "qNegValues": 1,
      "qPosValues": 1,
      "qZeroValues": 1,
      "qSum": 1,
      "qSum2": 1,
      "qAverage": 1,
      "qMedian": 1,
      "qStd": 1,
      "qMin": 1,
      "qMax": 1,
      "qSkewness": 1,
      "qKurtosis": 1,
      "qFractiles": [
        1
      ],
      "qEmptyStrings": 1,
      "qMaxStringLen": 1,
      "qMinStringLen": 1,
      "qSumStringLen": 1,
      "qAvgStringLen": 1,
      "qFirstSorted": "value",
      "qLastSorted": "value",
      "qMostFrequent": [
        {
          "qSymbol": {
            "qText": "value",
            "qNumber": 1
          },
          "qFrequency": 1
        }
      ],
      "qFrequencyDistribution": {
        "qNumberOfBins": 1,
        "qBinsEdges": [
          1
        ],
        "qFrequencies": [
          1
        ]
      }
    }
  ]
}

DocGetTablesAndKeys(qWindowSize, qNullSize, qCellHeight, qSyntheticMode, qIncludeSysVars, qIncludeProfiling?)

Returns:

  • The list of tables in an app and the fields inside each table.
  • The list of derived fields.
  • The list of key fields.

Parameters

qWindowSize

Size of the window that is used to display the results.

qNullSize

No description

qCellHeight
integer

Height of a cell in a table in pixels.

qSyntheticMode
boolean

One of:

  • true for internal table viewer: Shows a more detailed view on how the Qlik engine defines the relations between fields and the quality of the keys.
  • false for source table viewer: Shows the natural relation between fields without reference to synthetic keys and resultant linking synthetic tables. Instead synthetic keys are represented by multiple connectors between tables.
qIncludeSysVars
boolean

If set to true, the system variables are included.

qIncludeProfiling
optional
boolean

If set to true, profiling information is included.

Returns

Results for Doc.GetTablesAndKeys

No description

Errors

No description

const result = await doc.getTablesAndKeys({
  "qWindowSize": {
    "qcx": 1,
    "qcy": 1
  },
  "qNullSize": {
    "qcx": 1,
    "qcy": 1
  },
  "qCellHeight": 1,
  "qSyntheticMode": true,
  "qIncludeSysVars": true,
  "qIncludeProfiling": true
});
// console.log(result);
[
  {
    "qName": "value",
    "qLoose": true,
    "qNoOfRows": 1,
    "qFields": [
      {
        "qName": "value",
        "qOriginalFields": [
          "value"
        ],
        "qPresent": true,
        "qHasNull": true,
        "qHasWild": true,
        "qHasDuplicates": true,
        "qIsSynthetic": true,
        "qInformationDensity": 1,
        "qnNonNulls": 1,
        "qnRows": 1,
        "qSubsetRatio": 1,
        "qnTotalDistinctValues": 1,
        "qnPresentDistinctValues": 1,
        "qKeyType": "value",
        "qComment": "value",
        "qTags": [
          "value"
        ],
        "qDerivedFields": [
          {
            "qDefinitionName": "value",
            "qTags": [
              "value"
            ],
            "qActive": true
          }
        ],
        "qIsFieldOnTheFly": true,
        "qReadableName": "value"
      }
    ],
    "qPos": {
      "qx": 1,
      "qy": 1
    },
    "qComment": "value",
    "qIsDirectDiscovery": true,
    "qIsSynthetic": true,
    "qTableTags": [
      "value"
    ],
    "qProfilingData": {
      "qNoOfRows": 1,
      "qFieldProfiling": [
        {
          "qName": "value",
          "qFieldTags": [
            "value"
          ],
          "qNumberFormat": {
            "qType": "value",
            "qnDec": 1,
            "qUseThou": 1,
            "qFmt": "value",
            "qDec": "value",
            "qThou": "value"
          },
          "qDistinctValues": 1,
          "qDistinctNumericValues": 1,
          "qDistinctTextValues": 1,
          "qNumericValues": 1,
          "qNullValues": 1,
          "qTextValues": 1,
          "qNegValues": 1,
          "qPosValues": 1,
          "qZeroValues": 1,
          "qSum": 1,
          "qSum2": 1,
          "qAverage": 1,
          "qMedian": 1,
          "qStd": 1,
          "qMin": 1,
          "qMax": 1,
          "qSkewness": 1,
          "qKurtosis": 1,
          "qFractiles": [
            1
          ],
          "qEmptyStrings": 1,
          "qMaxStringLen": 1,
          "qMinStringLen": 1,
          "qSumStringLen": 1,
          "qAvgStringLen": 1,
          "qFirstSorted": "value",
          "qLastSorted": "value",
          "qMostFrequent": [
            {
              "qSymbol": {
                "qText": "value",
                "qNumber": 1
              },
              "qFrequency": 1
            }
          ],
          "qFrequencyDistribution": {
            "qNumberOfBins": 1,
            "qBinsEdges": [
              1
            ],
            "qFrequencies": [
              1
            ]
          }
        }
      ]
    }
  }
]

DocGetTextMacros()

Fetches updated variables after a statement execution.

If qRefSeqNo and qSetSeqNo are set to 0, it means that the variables were not updated.

Returns

qMacros

No description

Errors

No description

const result = await doc.getTextMacros({});
// console.log(result);
[
  {
    "qTag": "value",
    "qRefSeqNo": 1,
    "qSetSeqNo": 1,
    "qDisplayString": "value",
    "qIsSystem": true,
    "qIsReserved": true
  }
]

DocGetVariable(qName)

deprecatedUse Doc::GetVariableById method or Doc::GetVariableByName method instead

Returns a handle to a variable.

Parameters

qName
string

Name of the variable.

Returns

qReturn

No description

Errors

No description

const result = await doc.getVariable({
  "qName": "value"
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocGetVariableById(qId)

Gets the handle of a variable.

Parameters

qId
string

Identifier of the variable.

Returns

qReturn

No description

Errors

No description

const result = await doc.getVariableById({
  "qId": "value"
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocGetVariableByName(qName)

Gets the handle of a variable.

Parameters

qName
string

Name of the variable.

Returns

qReturn

No description

Errors

No description

const result = await doc.getVariableByName({
  "qName": "value"
});
// console.log(result);
// result is an enigma model, for example: result.getLayout()
{
  id: 'xyz',
  handle: 1,
  getLayout: () => {},
  setProperties: () => {},
}

DocGetVariables(qListDef)

Parameters

qListDef

No description

Returns

qList

No description

Errors

No description

const result = await doc.getVariables({
  "qListDef": {
    "qType": "value",
    "qShowReserved": true,
    "qShowConfig": true,
    "qData": {},
    "qShowSession": true
  }
});
// console.log(result);
[
  {
    "qName": "value",
    "qDescription": "value",
    "qDefinition": "value",
    "qIsConfig": true,
    "qIsReserved": true,
    "qMeta": {
      "qName": "value"
    },
    "qInfo": {
      "qId": "value",
      "qType": "value"
    },
    "qData": {},
    "qIsScriptCreated": true
  }
]

DocGetViewDlgSaveInfo()

Returns information about the position of the tables in the data model viewer.

The position of the broom points and the position of the connection points cannot be retrieved in Qlik Sense.

Representation of tables, broom points and connection points


The green circles represent the broom points. The red circle represents a connection point.

Returns

qReturn

No description

Errors

No description

const result = await doc.getViewDlgSaveInfo({});
// console.log(result);
{
  "qPos": {
    "qLeft": 1,
    "qTop": 1,
    "qWidth": 1,
    "qHeight": 1
  },
  "qCtlInfo": {
    "qInternalView": {
      "qTables": [
        {
          "qPos": {
            "qLeft": 1,
            "qTop": 1,
            "qWidth": 1,
            "qHeight": 1
          },
          "qCaption": "value"
        }
      ],
      "qBroomPoints": [
        {
          "qPos": {
            "qx": 1,
            "qy": 1
          },
          "qTable": "value",
          "qFields": [
            "value"
          ]
        }
      ],
      "qConnectionPoints": [
        {
          "qPos": {
            "qx": 1,
            "qy": 1
          },
          "qFields": [
            "value"
          ]
        }
      ],
      "qZoomFactor": 1
    },
    "qSourceView": {
      "qTables": [
        {
          "qPos": {
            "qLeft": 1,
            "qTop": 1,
            "qWidth": 1,
            "qHeight": 1
          },
          "qCaption": "value"
        }
      ],
      "qBroomPoints": [
        {
          "qPos": {
            "qx": 1,
            "qy": 1
          },
          "qTable": "value",
          "qFields": [
            "value"
          ]
        }
      ],
      "qConnectionPoints": [
        {
          "qPos": {
            "qx": 1,
            "qy": 1
          },
          "qFields": [
            "value"
          ]
        }
      ],
      "qZoomFactor": 1
    }
  },
  "qMode": 1
}

DocGuessFileType(qConnectionId, qRelativePath?)

Guesses the data format for a given file. Recognized file formats are:

  • CSV for Delimited
  • FIX for Fixed Record
  • DIF for Data Interchange Format
  • EXCEL_BIFF for Microsoft Excel (XLS)
  • EXCEL_OOXML for Microsoft Excel (XLSX)
  • HTML for HTML
  • QVD for QVD file
  • XML for XML
  • QVX for QVX file
  • JSON for JSON format
  • KML for KML file

FileType

Recognized file formats are:

  • CSV for Delimited
  • FIX for Fixed Record
  • DIF for Data Interchange Format
  • EXCEL_BIFF for Microsoft Excel (XLS)
  • EXCEL_OOXML for Microsoft Excel (XLSX)
  • HTML for HTML
  • QVD for QVD file
  • XML for XML
  • QVX for QVX file
  • JSON for JSON format
  • KML for KML file

Parameters

qConnectionId
string

Identifier of the connection file.

qRelativePath
optional
string

Path of the connection file.

Returns

qDataFormat

No description

Errors

No description

const result = await doc.guessFileType({
  "qConnectionId": "value",
  "qRelativePath": "value"
});
// console.log(result);
{
  "qType": "value",
  "qLabel": "value",
  "qQuote": "value",
  "qComment": "value",
  "qDelimiter": {
    "qName": "value",
    "qScriptCode": "value",
    "qNumber": 1,
    "qIsMultiple": true
  },
  "qCodePage": 1,
  "qHeaderSize": 1,
  "qRecordSize": 1,
  "qTabSize": 1,
  "qIgnoreEOF": true,
  "qFixedWidthDelimiters": "value"
}

DocLockAll(qStateName?)

Locks all selections in fields for current state.

Parameters

qStateName
optional
string

Alternate state name. When set, applies to alternate state instead of current.

Returns

Results for Doc.LockAll
object

No description

Errors

No description

const result = await doc.lockAll({
  "qStateName": "value"
});
// console.log(result);
undefined

DocModifyConnection(qConnectionId, qConnection, qOverrideCredentials?)

Updates a connection.

The identifier of a connection cannot be updated. qType cannot be modified with the ModifyConnection method.

Parameters

qConnectionId
string

Identifier of the connection.

qConnection

Information about the connection. Properties that can be updated.

qOverrideCredentials
optional
boolean

Set this parameter to true to override the user name and password.

Returns

Results for Doc.ModifyConnection
object

No description

Errors

No description

const result = await doc.modifyConnection({
  "qConnectionId": "value",
  "qConnection": {
    "qId": "value",
    "qName": "value",
    "qConnectionString": "value",
    "qType": "value",
    "qUserName": "value",
    "qPassword": "value",
    "qModifiedDate": "value",
    "qMeta": {
      "qName": "value"
    },
    "qLogOn": "value"
  },
  "qOverrideCredentials": true
});
// console.log(result);
undefined

DocPublish(qStreamId, qName?)

Publishes an app. All app objects are published. Generic objects, bookmarks, dimensions and measures inside the app are published.

An app can only be published once and cannot be published to more than one stream.

Parameters

qStreamId
string

Identifier of the stream.

qName
optional
string

Name of the published app. If this parameter is not set, the engine automatically gives a new name to the published app.

Returns

Results for Doc.Publish
object

No description

Errors

No description

const result = await doc.publish({
  "qStreamId": "value",
  "qName": "value"
});
// console.log(result);
undefined

DocRedo()

Redoes the previous operation.

The operation is successful if **qSuccess** is set to true.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.redo({});
// console.log(result);
true

DocRemoveAlternateState(qStateName)

Removes an alternate state in the app.

Parameters

qStateName
string

Name of the alternate state.

Returns

Results for Doc.RemoveAlternateState
object

No description

Errors

No description

const result = await doc.removeAlternateState({
  "qStateName": "value"
});
// console.log(result);
undefined

DocRemoveSessionAlternateState(qStateName)

Removes an session alternate state in the app.

The operation is successful if **qSuccess** is set to true.

Parameters

qStateName
string

Name of the alternate state.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.removeSessionAlternateState({
  "qStateName": "value"
});
// console.log(result);
true

DocRemoveVariable(qName)

deprecatedUse Doc::DestroyVariableById method or Doc::DestroyVariableByName method instead

Removes a variable.

Parameters

qName
string

Name of the variable. Variable names are case sensitive.

Returns

qReturn
boolean

No description

Errors

No description

const result = await doc.removeVariable({
  "qName": "value"
});
// console.log(result);
true

DocRestoreTempSelectionState(qId)

Restore a temporary selection state identified by Id.

Parameters

qId
string

Identifier of the temporary selection state

Returns

qReturn
boolean

No description

Errors

No description

const result = await doc.restoreTempSelectionState({
  "qId": "value"
});
// console.log(result);
true

DocResume()

Resumes the app as the user left it.

Returns

Results for Doc.Resume
object

No description

Errors

No description

const result = await doc.resume({});
// console.log(result);
undefined

DocSaveAs(qNewAppName)

Save a copy of an app with a different name. Can be used to save a session app as an ordinary app.

Parameters

qNewAppName
string

<Name of the saved app>

Returns

qNewAppId
string

No description

Errors

No description

const result = await doc.saveAs({
  "qNewAppName": "value"
});
// console.log(result);
"value"

DocSaveObjects()

Saves all objects that were modified in the app.

Data from the data model are not saved.
This operation is possible only in Qlik Sense Enterprise.

Returns

Results for Doc.SaveObjects
object

No description

Errors

No description

const result = await doc.saveObjects({});
// console.log(result);
undefined

DocScramble(qFieldName)

Scrambles a field so the data is not recognizable. Some properties are retained to help debugging. For example, special characters are not changed, and small numbers are scrambled to another small number.

Update access is required to use the function in Qlik Sense Enterprise.

Parameters

qFieldName
string

Name of the field to scramble.

Returns

Results for Doc.Scramble
object

No description

Errors

No description

const result = await doc.scramble({
  "qFieldName": "value"
});
// console.log(result);
undefined

DocSearchAssociations(qOptions, qTerms, qPage)

deprecatedUse SearchResults method instead

Returns the search matches for one or more search terms. The search results depend on the search context. SearchCombinationOptions

SearchMatchCombinations

NameDescriptionType
qSearchMatchCombinationsArray of search combinations.Array of SearchMatchCombination

Parameters

qOptions

Information about the search fields and the search context.

qTerms
Array<string>

List of terms to search for.

qPage

Array of pages to retrieve.

Returns

qResults

No description

Errors

No description

const result = await doc.searchAssociations({
  "qOptions": {
    "qSearchFields": [
      "value"
    ],
    "qContext": "value",
    "qCharEncoding": "value",
    "qAttributes": [
      "value"
    ]
  },
  "qTerms": [
    "value"
  ],
  "qPage": {
    "qOffset": 1,
    "qCount": 1,
    "qMaxNbrFieldMatches": 1,
    "qGroupOptions": [
      {
        "qGroupType": "value",
        "qOffset": 1,
        "qCount": 1
      }
    ],
    "qGroupItemOptions": [
      {
        "qGroupItemType": "value",
        "qOffset": 1,
        "qCount": 1
      }
    ]
  }
});
// console.log(result);
{
  "qFieldNames": [
    "value"
  ],
  "qSearchTerms": [
    "value"
  ],
  "qFieldDictionaries": [
    {
      "qField": 1,
      "qResult": [
        {
          "qText": "value",
          "qElemNumber": 1,
          "qRanges": [
            {
              "qCharPos": 1,
              "qCharCount": 1,
              "qTerm": 1
            }
          ]
        }
      ]
    }
  ],
  "qSearchTermsMatched": [
    [
      {
        "qId": 1,
        "qFieldMatches": [
          {
            "qField": 1,
            "qValues": [
              1
            ],
            "qTerms": [
              1
            ],
            "qNoOfMatches": 1
          }
        ]
      }
    ]
  ],
  "qTotalSearchResults": 1
}

DocSearchObjects(qOptions, qTerms, qPage)

Returns the generic objects corresponding to one or more search terms. The search is performed within the title, subtitle, footnote and type. In addition, associated dimension values are also searched in. For example, if the country “Japan” is selected and the object contains the dimension City, the object will appear in the results for “Osaka” but not for “Johannesburg”. The generic objects with the following types will never appear in the results: slideitem , sheet , story , slide , masterobject , snapshot , LoadModel , appprops and searchhistory .

Parameters

qOptions

Information about attributes.

qTerms
Array<string>

Terms to search for.

qPage

Array of pages to retrieve.

Returns

qResult

No description

Errors

No description

const result = await doc.searchObjects({
  "qOptions": {
    "qAttributes": [
      "value"
    ],
    "qCharEncoding": "value"
  },
  "qTerms": [
    "value"
  ],
  "qPage": {
    "qOffset": 1,
    "qCount": 1,
    "qMaxNbrFieldMatches": 1,
    "qGroupOptions": [
      {
        "qGroupType": "value",
        "qOffset": 1,
        "qCount": 1
      }
    ],
    "qGroupItemOptions": [
      {
        "qGroupItemType": "value",
        "qOffset": 1,
        "qCount": 1
      }
    ]
  }
});
// console.log(result);
{
  "qSearchTerms": [
    "value"
  ],
  "qTotalNumberOfGroups": 1,
  "qSearchGroupArray": [
    {
      "qId": 1,
      "qGroupType": "value",
      "qSearchTermsMatched": [
        1
      ],
      "qTotalNumberOfItems": 1,
      "qItems": [
        {
          "qItemType": "value",
          "qTotalNumberOfMatches": 1,
          "qIdentifier": "value",
          "qItemMatches": [
            {
              "qText": "value",
              "qFieldSelectionMode": "value",
              "qRanges": [
                {
                  "qCharPos": 1,
                  "qCharCount": 1,
                  "qTerm": 1
                }
              ],
              "qAttributes": [
                {
                  "qKey": "value",
                  "qValue": "value"
                }
              ]
            }
          ],
          "qSearchTermsMatched": [
            1
          ]
        }
      ]
    }
  ]
}

DocSearchResults(qOptions, qTerms, qPage)

Returns the search matches for one or more search terms. Search results are organized in search groups. The type of search group indicates where the search matches come from (from data for example). Each search group contains search results that correspond to a combination of search terms. For example, if the search terms are organic , pasta , and America , the possible combination of search groups are:

  • organic
  • pasta
  • America
  • organic, pasta, America
  • organic, pasta
  • organic, America
  • pasta, America

For every search group, there are one or more search group items. Each subgroup item contains results that correspond to an item type (for example a field). For every search group item, there are one or several search matches. The position of the match in each search result is given.

Parameters

qOptions

Information about the search combinations.

qTerms
Array<string>

Terms to search for.

qPage

Array of pages to retrieve.

Returns

qResult

No description

Errors

No description

const result = await doc.searchResults({
  "qOptions": {
    "qSearchFields": [
      "value"
    ],
    "qContext": "value",
    "qCharEncoding": "value",
    "qAttributes": [
      "value"
    ]
  },
  "qTerms": [
    "value"
  ],
  "qPage": {
    "qOffset": 1,
    "qCount": 1,
    "qMaxNbrFieldMatches": 1,
    "qGroupOptions": [
      {
        "qGroupType": "value",
        "qOffset": 1,
        "qCount": 1
      }
    ],
    "qGroupItemOptions": [
      {
        "qGroupItemType": "value",
        "qOffset": 1,
        "qCount": 1
      }
    ]
  }
});
// console.log(result);
{
  "qSearchTerms": [
    "value"
  ],
  "qTotalNumberOfGroups": 1,
  "qSearchGroupArray": [
    {
      "qId": 1,
      "qGroupType": "value",
      "qSearchTermsMatched": [
        1
      ],
      "qTotalNumberOfItems": 1,
      "qItems": [
        {
          "qItemType": "value",
          "qTotalNumberOfMatches": 1,
          "qIdentifier": "value",
          "qItemMatches": [
            {
              "qText": "value",
              "qFieldSelectionMode": "value",
              "qRanges": [
                {
                  "qCharPos": 1,
                  "qCharCount": 1,
                  "qTerm": 1
                }
              ],
              "qAttributes": [
                {
                  "qKey": "value",
                  "qValue": "value"
                }
              ]
            }
          ],
          "qSearchTermsMatched": [
            1
          ]
        }
      ]
    }
  ]
}

DocSearchSuggest(qOptions, qTerms)

Returns search terms suggestions.

Parameters

qOptions

Information about the search combinations.

qTerms
Array<string>

Terms to search for.

Returns

qResult

No description

Errors

No description

const result = await doc.searchSuggest({
  "qOptions": {
    "qSearchFields": [
      "value"
    ],
    "qContext": "value",
    "qCharEncoding": "value",
    "qAttributes": [
      "value"
    ]
  },
  "qTerms": [
    "value"
  ]
});
// console.log(result);
{
  "qSuggestions": [
    {
      "qValue": "value",
      "qTerm": 1
    }
  ],
  "qFieldNames": [
    "value"
  ]
}

DocSearchValues(qOptions, qTerms, qPage)

experimental

Parameters

qOptions

No description

qTerms
Array<string>

No description

qPage

No description

Returns

qResult

No description

Errors

No description

const result = await doc.searchValues({
  "qOptions": {
    "qSearchFields": [
      "value"
    ]
  },
  "qTerms": [
    "value"
  ],
  "qPage": {
    "qOffset": 1,
    "qCount": 1,
    "qMaxNbrFieldMatches": 1
  }
});
// console.log(result);
{
  "qSearchTerms": [
    "value"
  ],
  "qFieldMatches": [
    {
      "qFieldName": "value",
      "qValues": [
        {
          "qText": "value",
          "qElemNo": 1,
          "qSearchTermsMatched": [
            1
          ]
        }
      ]
    }
  ]
}

DocSelectAssociations(qOptions, qTerms, qMatchIx, qSoftLock?)

Selects all search hits for a specified group. The results depend on the search context. SearchCombinationOptions.

Parameters

qOptions

Information about the search fields and the search context.

qTerms
Array<string>

List of terms to search for.

qMatchIx
integer

Index (value of qId ) of the search result to select.

qSoftLock
optional
boolean

This parameter is deprecated and should not be set.

Returns

Results for Doc.SelectAssociations
object

No description

Errors

No description

const result = await doc.selectAssociations({
  "qOptions": {
    "qSearchFields": [
      "value"
    ],
    "qContext": "value",
    "qCharEncoding": "value",
    "qAttributes": [
      "value"
    ]
  },
  "qTerms": [
    "value"
  ],
  "qMatchIx": 1,
  "qSoftLock": true
});
// console.log(result);
undefined

DocSendGenericCommandToCustomConnector(qProvider, qCommand, qMethod, qParameters, qAppendConnection)

Sends a generic command to a custom connector. For more information on the commands that can be sent to a custom connector, see the QVX SDK help.

Parameters

qProvider
string

Connector file name. Command to be executed by the connector.

qCommand
string

One of:

  • JsonRequest
  • GetCustomCaption
  • IsConnected
  • DisableQlikViewSelectButton
  • HaveStarField
qMethod
string

Method name to be used within the command. The available methods depend on the chosen connector.

qParameters
Array<string>

Parameters of the command. No parameters are required.

qAppendConnection
string

Name of the connection.

Returns

qResult
string

No description

Errors

No description

const result = await doc.sendGenericCommandToCustomConnector({
  "qProvider": "value",
  "qCommand": "value",
  "qMethod": "value",
  "qParameters": [
    "value"
  ],
  "qAppendConnection": "value"
});
// console.log(result);
"value"

DocSetAppProperties(qProp)

Sets properties to an app.

The qLastReloadTime, qMigrationHash and qSavedInProductVersion properties does not need to be set but if they are, they should match the current values in the app layout.

Parameters

qProp

Information about the properties of an app.

Returns

Results for Doc.SetAppProperties
object

No description

Errors

No description

const result = await doc.setAppProperties({
  "qProp": {
    "qTitle": "value",
    "qLastReloadTime": "value",
    "qMigrationHash": "value",
    "qSavedInProductVersion": "value",
    "qThumbnail": {
      "qUrl": "value"
    },
    "qHasSectionAccess": true
  }
});
// console.log(result);
undefined

DocSetFavoriteVariables(qNames)

Set some variables as favorite.

Parameters

qNames
Array<string>

Variables to set as favorite.

Returns

Results for Doc.SetFavoriteVariables
object

No description

Errors

No description

const result = await doc.setFavoriteVariables({
  "qNames": [
    "value"
  ]
});
// console.log(result);
undefined

DocSetFetchLimit(qLimit)

Limits the number of rows of data to load from a data source. This method works when reloading in debug mode.

Parameters

qLimit
integer

Fetch limit. Number of rows to load.

Returns

Results for Doc.SetFetchLimit
object

No description

Errors

No description

const result = await doc.setFetchLimit({
  "qLimit": 1
});
// console.log(result);
undefined

DocSetLooselyCoupledVector(qv)

Sets a list of table states, one for each table.

The following states apply:

  • 0 The table is not loosely coupled.
  • 1 The table is loosely coupled.
  • 2 The table is loosely coupled and cannot be changed to another state using the Qlik Engine API.
The last three values in the vector are for internal use.

Parameters

qv
Array<integer<byte>>

The list of table states to set. A state will not be changed if already set to 2.

Returns

qReturn
boolean

No description

Errors

No description

const result = await doc.setLooselyCoupledVector({
  "qv": [
    1
  ]
});
// console.log(result);
true

DocSetScript(qScript)

Sets values in script.

Parameters

qScript
string

Script content.

Returns

Results for Doc.SetScript
object

No description

Errors

No description

const result = await doc.setScript({
  "qScript": "value"
});
// console.log(result);
undefined

DocSetScriptBreakpoints(qBreakpoints)

Set some breakpoints in the script of an app.

Parameters

qBreakpoints

Information about the breakpoints.

Returns

Results for Doc.SetScriptBreakpoints
object

No description

Errors

No description

const result = await doc.setScriptBreakpoints({
  "qBreakpoints": [
    {
      "qbufferName": "value",
      "qlineIx": 1,
      "qEnabled": true
    }
  ]
});
// console.log(result);
undefined

DocSetViewDlgSaveInfo(qInfo)

Sets the positions of the tables in the data model viewer.

The position of the broom points and the position of the connection points cannot be set in Qlik Sense.

Representation of tables, broom points and connection points


The green circles represent the broom points. The red circle represents a connection point.

Parameters

qInfo

Information about the table.

Returns

Results for Doc.SetViewDlgSaveInfo
object

No description

Errors

No description

const result = await doc.setViewDlgSaveInfo({
  "qInfo": {
    "qPos": {
      "qLeft": 1,
      "qTop": 1,
      "qWidth": 1,
      "qHeight": 1
    },
    "qCtlInfo": {
      "qInternalView": {
        "qTables": [
          {
            "qPos": {
              "qLeft": 1,
              "qTop": 1,
              "qWidth": 1,
              "qHeight": 1
            },
            "qCaption": "value"
          }
        ],
        "qBroomPoints": [
          {
            "qPos": {
              "qx": 1,
              "qy": 1
            },
            "qTable": "value",
            "qFields": [
              "value"
            ]
          }
        ],
        "qConnectionPoints": [
          {
            "qPos": {
              "qx": 1,
              "qy": 1
            },
            "qFields": [
              "value"
            ]
          }
        ],
        "qZoomFactor": 1
      },
      "qSourceView": {
        "qTables": [
          {
            "qPos": {
              "qLeft": 1,
              "qTop": 1,
              "qWidth": 1,
              "qHeight": 1
            },
            "qCaption": "value"
          }
        ],
        "qBroomPoints": [
          {
            "qPos": {
              "qx": 1,
              "qy": 1
            },
            "qTable": "value",
            "qFields": [
              "value"
            ]
          }
        ],
        "qConnectionPoints": [
          {
            "qPos": {
              "qx": 1,
              "qy": 1
            },
            "qFields": [
              "value"
            ]
          }
        ],
        "qZoomFactor": 1
      }
    },
    "qMode": 1
  }
});
// console.log(result);
undefined

DocStoreTempSelectionState(qTTLOfTempState?)

Store current selection state temporarily.

The temporary selection state will be stored for 30min by default if TTL parameter is not present or positive.

Parameters

qTTLOfTempState
optional
integer

Time to live in seconds for stored selection state

Returns

Results for Doc.StoreTempSelectionState

No description

Errors

No description

const result = await doc.storeTempSelectionState({
  "qTTLOfTempState": 1
});
// console.log(result);
true

DocUndo()

Undoes the previous operation.

The operation is successful if **qSuccess** is set to true.

Returns

qSuccess
boolean

No description

Errors

No description

const result = await doc.undo({});
// console.log(result);
true

DocUnlockAll(qStateName?)

Unlocks all selections in fields for current state.

Parameters

qStateName
optional
string

Alternate state name. When set, applies to alternate state instead of current.

Returns

Results for Doc.UnlockAll
object

No description

Errors

No description

const result = await doc.unlockAll({
  "qStateName": "value"
});
// console.log(result);
undefined
Was this page helpful?