# CheckExpression method

Checks if a given expression is valid.

Information note

The expression is correct if the parameters *qErrorMsg* , *qBadFieldNames* and *qDangerousFieldNames* are empty.

## Parameters

| Name | Description | Mandatory | Type |
| --- | --- | --- | --- |
| qExpr | Expression to check. | Yes | String |
| qLabels | List of labels. | No | Array of String |

## Returns

| Name | Description | Type |
| --- | --- | --- |
| qErrorMsg | Message displayed when there is a syntax error. | String |
| qBadFieldNames | A list of bad field names. | Array of [NxRange](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineJSONAPI/Content/models-nxrange.htm) |
| qDangerousFieldNames | A list of dangerous field names. | Array of [NxRange](https://help.qlik.com/en-US/sense-developer/November2024/Subsystems/EngineJSONAPI/Content/models-nxrange.htm) |