---
sourceDocument: Australia API Reference
sourceDocumentLink: https://servicenow-prod.fluidtopics.net/r/api-reference

 Release :

    - australia

ft:locale :

    - en-US

ft:publication_title :

    - Australia API Reference

ft:clusterId :

    - crapiref

bundleId :

    - crapiref

workflow :

    - Creator


---

# GlideQueryCondition - Global

# GlideQueryCondition - Global {#ariaid-title1}

Release version: Australia  
Updated March 12, 2026  
![](https://www.servicenow.com/docs/portal-asset/ico-clock) 11 minutes to read  
This API provides `AND` or `OR` conditions that can be added to the current condition, allowing you to build complex queries.  
You can use this API to build complex queries such as the following:

    category='hardware' OR category='software' AND priority='2' AND priority='1'

In the case of addCondition(), an implied `AND` is added.  
This class has no constructor. A GlideQueryCondition object is returned by the following methods:

* addActiveQuery()
* addInactiveQuery()
* addJoinQuery()
* addNotNullQuery()
* addNullQuery()
* addQuery()
{#c_GlideQueryConditionAPI__ul_xyz_nsg_qz}

If there is a complicated set of `AND` and `OR` queries, a single encoded query containing all conditions simplifies the query creation. To simplify the
query creation, create a query in a list view, right-click the query, and select Copy query. It creates a single encoded query string to return your result set. Use that string as a parameter in an
addEncodedQuery() call.

Always test queries on a sub-production instance prior to deploying them on a production instance. An incorrectly constructed encoded query, such as including an invalid
field name, produces an invalid query. When the invalid query is run, the invalid part of the query condition is dropped, and the results are based on the valid part of the query, which may return all records from the table.
Using an insert(), update(), deleteRecord(), or deleteMultiple() method on bad query results can result in data loss.

You can set the glide.invalid_query.returns_no_rows system property to true to have queries with invalid encoded queries return no records. In some cases, the query may still
return records in API results even when glide.invalid_query.returns_no_rows is set to true. This happens in queries where an invalid query term is used with a WHERE operator. In such queries, the WHERE
operator ignores the invalid term(s) but still interprets and returns the rest of the query statement. For more information about this system property and its functionality, see [Available system properties](https://www.servicenow.com/docs/access?context=r_AvailableSystemProperties&version=australia&pubname=australia-platform-administration&ft:locale=en-US).

## GlideQueryCondition - addCondition(String name, String oper, Object value) {#ariaid-title2}

Adds an AND condition to the current condition.
{#GQC-addCondition_S_S_O__table_vy2_525_jq__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | Field name |
| oper | String | (Optional) Query operator. The available values are dependent on the data type of the <var class="keyword varname">value</var> parameter. If you do not specify an operator, the condition uses an equals operator. Numbers: * = * != * \> * \>= * \< * \<= {#GQC-addCondition_S_S_O__ul_qyb_rbt_3y} Strings (must be in upper case): * = * != * IN * STARTSWITH * ENDSWITH * CONTAINS * DOESNOTCONTAIN {#GQC-addCondition_S_S_O__ul_egz_vbt_3y} |
| value | Object | Value on which to query (not case-sensitive). Note: All passed in arrays must contain a minimum of two elements. Single element arrays are not supported. |
[Table 1. Parameters]

{#GQC-addCondition_S_S_O__table_vy2_525_jq} {#GQC-addCondition_S_S_O__table_mxx_f5b_2r__entry__2}

| Type | Description |
|-|-|
| GlideQueryCondition | A reference to a GlideQueryConditon that was added to the GlideRecord. |
[Table 2. Returns]

{#GQC-addCondition_S_S_O__table_mxx_f5b_2r}  
The following example shows how to add an AND condition to a query.

    var now_GR = new GlideRecord('incident');
    var qc = now_GR.addQuery('category', 'Hardware');
    qc.addCondition('category', 'Network');
    now_GR.addQuery('number','INC0000003');
    now_GR.next();
    now_GR.number;
    gs.info(now_GR.getEncodedQuery());

Output:

    category=Hardware^ORcategory=Network^number=INC0000003

### Scoped equivalent {#GQC-addCondition_S_S_O__section_cgd_h3n_g1b}

To use the addCondition() method in a scoped application, use the
corresponding scoped method: [addCondition()](https://servicenow-prod.fluidtopics.net/AD69pEoBTofsaumFBhODsQ#r_ScopedGlideQueryConditionAddCondition "Adds an AND condition to the current condition.").

## GlideQueryCondition - addOrCondition(String name, String oper, Object value) {#ariaid-title3}

Appends a two-or-three parameter OR condition to an existing GlideQueryCondition.
This method works in conjunction with [GlideRecord addQuery()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#r_GlideRecord-AddQuery_String_Object_Object "Provides the ability to build a request, which when executed, returns the rows from the specified table that match the request.") to `OR` the specified query parameters to the query previously constructed using
addQuery().

The addOrCondition() can be called with only two parameters, table field and comparison value, such as `qc.addOrCondition('category',
'software');`. The operator in this case is assumed to be "equal to".
{#GQC-addOrCondition_S_S_O__table_vy2_525_jq__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | Field name |
| oper | String | (Optional) Query operator. The available values are dependent on the data type of the <var class="keyword varname">value</var> parameter. If you do not specify an operator, the condition uses an equals operator. Numbers: * = * != * \> * \>= * \< * \<= {#GQC-addOrCondition_S_S_O__ul_qyb_rbt_3y} Strings (must be in upper case): * = * != * IN * STARTSWITH * ENDSWITH * CONTAINS * DOESNOTCONTAIN {#GQC-addOrCondition_S_S_O__ul_egz_vbt_3y} |
| value | Object | Value on which to query (not case-sensitive). Note: All passed in arrays must contain a minimum of two elements. Single element arrays are not supported. |
[Table 3. Parameters]

{#GQC-addOrCondition_S_S_O__table_vy2_525_jq} {#GQC-addOrCondition_S_S_O__table_w2h_w2c_2r__entry__2}

| Type | Description |
|-|-|
| GlideQueryCondition | A reference to a GlideQueryConditon that was added to the GlideRecord. |
[Table 4. Returns]

{#GQC-addOrCondition_S_S_O__table_w2h_w2c_2r}  
The following example shows how to add an OR condition to a query.

    var now_GR = new GlideRecord('incident');
    var qc = now_GR.addQuery('category', 'Hardware');
    qc.addOrCondition('category', 'Network');
    now_GR.addQuery('number','INC0000004');
    now_GR.next();
    now_GR.number;
    gs.info(now_GR.getEncodedQuery());

Output:

    category=Hardware^ORcategory=Network^number=INC0000004

To group AND/OR statements to make complex queries, such as getting 10 incidents with a (state less than 3 OR greater than 5) AND (priority is 1 OR priority is 5).

    var myObj = new GlideRecord('incident');
    var q1 = myObj.addQuery('state', '<', 3);
    q1.addOrCondition('state', '>', 5);
    var q2 = myObj.addQuery('priority', 1);
    q2.addOrCondition('priority', 5);
    myObj.setLimit(10);
    myObj.query();

    while (myObj.next()) {
      gs.info('Incident: ' + myObj.getValue('number') + ' State: ' + myObj.getValue('state') + ' Priority: ' + myObj.getValue('priority'));
    }

Output:

    Incident: INC0000001 State: 7 Priority: 1
    Incident: INC0000004 State: 7 Priority: 1
    Incident: INC0000012 State: 7 Priority: 5
    Incident: INC0000013 State: 7 Priority: 1
    Incident: INC0000024 State: 7 Priority: 5
    Incident: INC0000028 State: 7 Priority: 5
    Incident: INC0000031 State: 2 Priority: 1
    Incident: INC0000057 State: 7 Priority: 5
    Incident: INC0000057 State: 2 Priority: 5
    Incident: INC0000058 State: 7 Priority: 5

### Scoped equivalent {#GQC-addOrCondition_S_S_O__section_cgd_h3n_g1b}

To use the addOrCondition() method in a scoped application, use the
corresponding scoped method: [addOrCondition()](https://servicenow-prod.fluidtopics.net/AD69pEoBTofsaumFBhODsQ#r_ScopedGlideQueryConditionAddOrCondition "Appends a two-or-three parameter OR condition to an existing GlideQueryCondition.").

## GlideQueryCondition - addSystemCondition(String name, String oper, Object value) {#ariaid-title4}

Adds an AND condition to the current condition.
Use this method to bypass query access.
Use this method when system-level access is intended, so that query ACL enforcement is explicitly bypassed for the user. Use [addUserCondition()](https://servicenow-prod.fluidtopics.net/9xf9WUOMRTsGZ~dyEgotfw#GQC-addUserCondition_S_S_O "Adds an AND condition to the current condition. Use this method to enforce query access based on the user.")
to enforce query access.  
Additional methods for system-level access that bypass query ACL checks:

* [addSystemOrCondition()](https://servicenow-prod.fluidtopics.net/9xf9WUOMRTsGZ~dyEgotfw#GQC-addSystemOrCondition_S_O_O "Appends a two-or-three parameter OR condition to an existing GlideQueryCondition. Use this method to bypass query access.")
* [GlideRecord - addSystemEncodedQuery()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addSystemEncodedQuery_S "Adds a query using an encoded query string. Use this method to bypass query access.")
* [GlideRecord - addSystemOrderBy()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addSystemOrderBy_S "Specifies an orderBy column. Use this method to bypass query access.")
* [GlideRecord - addSystemOrderByDesc()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addSystemOrderByDesc_S "Specifies a descending orderBy column. Use this method to bypass query access.")
* [GlideRecord - addSystemQuery()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addSystemQuery_S_O_O "Provides the ability to build a request, which when executed, returns the rows from the specified table, that match the request. Use this method to bypass query access.")
{#GQC-addSystemCondition_S_S_O__ul_znd_wlp_53c}
{#GQC-addSystemCondition_S_S_O__table_vy2_525_jq__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | Field name |
| oper | String | (Optional) Query operator. The available values are dependent on the data type of the <var class="keyword varname">value</var> parameter. If you do not specify an operator, the condition uses an equals operator. Numbers: * = * != * \> * \>= * \< * \<= {#GQC-addSystemCondition_S_S_O__ul_qyb_rbt_3y} Strings (must be in upper case): * = * != * IN * STARTSWITH * ENDSWITH * CONTAINS * DOESNOTCONTAIN {#GQC-addSystemCondition_S_S_O__ul_egz_vbt_3y} |
| value | Object | Value on which to query (not case-sensitive). Note: All passed in arrays must contain a minimum of two elements. Single element arrays are not supported. |
[Table 5. Parameters]

{#GQC-addSystemCondition_S_S_O__table_vy2_525_jq} {#GQC-addSystemCondition_S_S_O__table_mxx_f5b_2r__entry__2}

| Type | Description |
|-|-|
| GlideQueryCondition | A reference to a GlideQueryConditon that was added to the GlideRecord. |
[Table 6. Returns]

{#GQC-addSystemCondition_S_S_O__table_mxx_f5b_2r}  
To group AND statements to make complex queries, such as getting 20 incidents with a (state less than 3 AND not 2) and (priority is greater than 1 AND priority is not 5).

    var myObj = new GlideRecord('incident');
    var q1 = myObj.addSystemQuery('state', '<', 3);
    q1.addSystemCondition('state', '!=', 2);
    var q2 = myObj.addSystemQuery('priority', '>', 1);
    q2.addSystemCondition('priority', '!=', 5);
    myObj.setLimit(20);
    myObj.query();

    while (myObj.next()) {
      gs.info('Incident: ' + myObj.getValue('number') + ' State: ' + myObj.getValue('state') + ' Priority: ' + myObj.getValue('priority'));
    }

Output:

    Incident: INC0011238 State: 1 Priority: 4
    Incident: INC0010127 State: 1 Priority: 2
    Incident: INC0010143 State: 1 Priority: 2
    Incident: INC0011760 State: 1 Priority: 2
    Incident: INC0010708 State: 1 Priority: 3
    Incident: INC0013048 State: 1 Priority: 4
    Incident: INC0010658 State: 1 Priority: 2
    Incident: INC0012021 State: 1 Priority: 3
    Incident: INC0013308 State: 1 Priority: 4
    Incident: INC0010155 State: 1 Priority: 3
    Incident: INC0013312 State: 1 Priority: 4
    Incident: INC0013049 State: 1 Priority: 3
    Incident: INC0010068 State: 1 Priority: 4
    Incident: INC0010135 State: 1 Priority: 2
    Incident: INC0010132 State: 1 Priority: 4
    Incident: INC0010700 State: 1 Priority: 3
    Incident: INC0013311 State: 1 Priority: 2
    Incident: INC0011758 State: 1 Priority: 4
    Incident: INC0012278 State: 1 Priority: 3
    Incident: INC0013306 State: 1 Priority: 4

## GlideQueryCondition - addSystemOrCondition(String name, String oper, Object value) {#ariaid-title5}

Appends a two-or-three parameter OR condition to an existing GlideQueryCondition.
Use this method to bypass query access.
Use this method when system-level access is intended, so that query ACL enforcement is explicitly bypassed for the user. Use [addUserOrCondition](https://servicenow-prod.fluidtopics.net/9xf9WUOMRTsGZ~dyEgotfw#GQC-addUserOrCondition_S_O_O "Appends a two-or-three parameter OR condition to an existing GlideQueryCondition. Use this method to enforce query access based on the user.")
to enforce query access.  
Additional methods for system-level access that bypass query ACL checks:

* [addSystemCondition()](https://servicenow-prod.fluidtopics.net/9xf9WUOMRTsGZ~dyEgotfw#GQC-addSystemCondition_S_S_O "Adds an AND condition to the current condition. Use this method to bypass query access.")
* [GlideRecord - addSystemEncodedQuery()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addSystemEncodedQuery_S "Adds a query using an encoded query string. Use this method to bypass query access.")
* [GlideRecord - addSystemOrderBy()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addSystemOrderBy_S "Specifies an orderBy column. Use this method to bypass query access.")
* [GlideRecord - addSystemOrderByDesc()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addSystemOrderByDesc_S "Specifies a descending orderBy column. Use this method to bypass query access.")
* [GlideRecord - addSystemQuery()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addSystemQuery_S_O_O "Provides the ability to build a request, which when executed, returns the rows from the specified table, that match the request. Use this method to bypass query access.")
{#GQC-addSystemOrCondition_S_O_O__ul_znd_wlp_53c}

The addSystemOrCondition() method works with the [GlideRecord addSystemQuery()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addSystemQuery_S_O_O "Provides the ability to build a request, which when executed, returns the rows from the specified table, that match the request. Use this method to bypass query access.") method to `OR` the specified query parameters to the query previously constructed using addSystemQuery().
{#GQC-addSystemOrCondition_S_O_O__table_vy2_625_jq__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | Field name |
| oper | String | (Optional) Query operator. The available values are dependent on the data type of the <var class="keyword varname">value</var> parameter. If you do not specify an operator, the condition uses an equals operator. Numbers: * = * != * \> * \>= * \< * \<= {#GQC-addSystemOrCondition_S_O_O__ul_qyb_rbt_3y} Strings (must be in upper case): * = * != * IN * STARTSWITH * ENDSWITH * CONTAINS * DOESNOTCONTAIN {#GQC-addSystemOrCondition_S_O_O__ul_egz_vbt_3y} |
| value | Object | Value on which to query (not case-sensitive). Note: All passed in arrays must contain a minimum of two elements. Single element arrays are not supported. |
[Table 7. Parameters]

{#GQC-addSystemOrCondition_S_O_O__table_vy2_625_jq} {#GQC-addSystemOrCondition_S_O_O__table_w2h_w2c_2r__entry__2}

| Type | Description |
|-|-|
| GlideQueryCondition | A reference to a GlideQueryConditon that was added to the GlideRecord. |
[Table 8. Returns]

{#GQC-addSystemOrCondition_S_O_O__table_w2h_w2c_2r}  
To group AND/OR statements to make complex queries, such as getting 20 incidents with a (state less than 3 OR greater than 5) AND (priority is 1 OR priority is 5).

    var myObj = new GlideRecord('incident');
    var q1 = myObj.addSystemQuery('state', '<', 3);
    q1.addSystemOrCondition('state', '>', 5);
    var q2 = myObj.addSystemQuery('priority', 1);
    q2.addSystemOrCondition('priority', 5);
    myObj.setLimit(20);
    myObj.query();

    while (myObj.next()) {
      gs.info('Incident: ' + myObj.getValue('number') + ' State: ' + myObj.getValue('state') + ' Priority: ' + myObj.getValue('priority'));
    }

Output:

    Incident: INC0000001 State: 7 Priority: 1
    Incident: INC0000004 State: 7 Priority: 1
    Incident: INC0000012 State: 7 Priority: 5
    Incident: INC0000013 State: 7 Priority: 1
    Incident: INC0000024 State: 7 Priority: 5
    Incident: INC0000028 State: 7 Priority: 5
    Incident: INC0000031 State: 2 Priority: 1
    Incident: INC0000057 State: 7 Priority: 5
    Incident: INC0000057 State: 2 Priority: 5
    Incident: INC0000058 State: 7 Priority: 5
    Incident: INC0000058 State: 2 Priority: 5
    Incident: INC0000059 State: 7 Priority: 5
    Incident: INC0000060 State: 7 Priority: 5
    Incident: INC0000061 State: 7 Priority: 5
    Incident: INC0000062 State: 7 Priority: 5
    Incident: INC0000064 State: 7 Priority: 5
    Incident: INC0000065 State: 7 Priority: 5
    Incident: INC0000066 State: 7 Priority: 5
    Incident: INC0000069 State: 7 Priority: 5
    Incident: INC0000072 State: 7 Priority: 5

## GlideQueryCondition - addUserCondition(String name, String oper, Object value) {#ariaid-title6}

Adds an AND condition to the current condition.
Use this method to enforce query access based on the user.
This method returns only records that the current user has query access to (based on ACLs).  
Related methods:

* [addCondition()](https://servicenow-prod.fluidtopics.net/AD69pEoBTofsaumFBhODsQ#r_ScopedGlideQueryConditionAddCondition "Adds an AND condition to the current condition.") provides the same functionality without ACL enforcement.
* [addSystemCondition()](https://servicenow-prod.fluidtopics.net/9xf9WUOMRTsGZ~dyEgotfw#GQC-addSystemCondition_S_S_O "Adds an AND condition to the current condition. Use this method to bypass query access.") bypasses query access checks.
{#GQC-addUserCondition_S_S_O__ul_i2h_csq_53c}  
Additional methods for enforcing query ACL checks:

* [addUserOrCondition()](https://servicenow-prod.fluidtopics.net/9xf9WUOMRTsGZ~dyEgotfw#GQC-addUserOrCondition_S_O_O "Appends a two-or-three parameter OR condition to an existing GlideQueryCondition. Use this method to enforce query access based on the user.")
* [GlideRecord - addUserEncodedQuery()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addUserEncodedQuery_S "Adds a query using an encoded query string. Use this method to enforce query access based on the user.")
* [GlideRecord - addUserOrderBy()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addUserOrderBy_S "Specifies an orderBy column. Use this method to enforce query access based on the user.")
* [GlideRecord - addUserOrderByDesc()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addUserOrderByDesc_S "Specifies a descending orderBy column. Use this method to enforce query access based on the user.")
* [GlideRecord - addUserQuery()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addUserQuery_S_O_O "Provides the ability to build a request, which when executed, returns the rows from the specified table that match the request. The calling user must have access to perform the specified query operation on the field for this request to be added. Use this method to enforce query access based on the user.")
{#GQC-addUserCondition_S_S_O__ul_znd_wlp_53c}
{#GQC-addUserCondition_S_S_O__table_vy2_525_jq__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | Field name |
| oper | String | (Optional) Query operator. The available values are dependent on the data type of the <var class="keyword varname">value</var> parameter. If you do not specify an operator, the condition uses an equals operator. Numbers: * = * != * \> * \>= * \< * \<= {#GQC-addUserCondition_S_S_O__ul_qyb_rbt_3y} Strings (must be in upper case): * = * != * IN * STARTSWITH * ENDSWITH * CONTAINS * DOESNOTCONTAIN {#GQC-addUserCondition_S_S_O__ul_egz_vbt_3y} |
| value | Object | Value on which to query (not case-sensitive). Note: All passed in arrays must contain a minimum of two elements. Single element arrays are not supported. |
[Table 9. Parameters]

{#GQC-addUserCondition_S_S_O__table_vy2_525_jq} {#GQC-addUserCondition_S_S_O__table_w2h_w2c_2r__entry__2}

| Type | Description |
|-|-|
| GlideQueryCondition | A reference to a GlideQueryConditon that was added to the GlideRecord. |
[Table 10. Returns]

{#GQC-addUserCondition_S_S_O__table_w2h_w2c_2r}  
To group AND statements to make complex queries, such as getting 20 incidents with a (state less than 3 AND not 2) and (priority is greater than 1 AND priority is not 5).

    var myObj = new GlideRecord('incident');
    var q1 = myObj.addUserQuery('state', '<', 3);
    q1.addUserCondition('state', '!=', 2);
    var q2 = myObj.addUserQuery('priority', '>', 1);
    q2.addUserCondition('priority', '!=', 5);
    myObj.setLimit(20);
    myObj.query();

    while (myObj.next()) {
      gs.info('Incident: ' + myObj.getValue('number') + ' State: ' + myObj.getValue('state') + ' Priority: ' + myObj.getValue('priority'));
    }

Output:

    Incident: INC0011238 State: 1 Priority: 4
    Incident: INC0010127 State: 1 Priority: 2
    Incident: INC0010143 State: 1 Priority: 2
    Incident: INC0011760 State: 1 Priority: 2
    Incident: INC0010708 State: 1 Priority: 3
    Incident: INC0013048 State: 1 Priority: 4
    Incident: INC0010658 State: 1 Priority: 2
    Incident: INC0012021 State: 1 Priority: 3
    Incident: INC0013308 State: 1 Priority: 4
    Incident: INC0010155 State: 1 Priority: 3
    Incident: INC0013312 State: 1 Priority: 4
    Incident: INC0013049 State: 1 Priority: 3
    Incident: INC0010068 State: 1 Priority: 4
    Incident: INC0010135 State: 1 Priority: 2
    Incident: INC0010132 State: 1 Priority: 4
    Incident: INC0010700 State: 1 Priority: 3
    Incident: INC0013311 State: 1 Priority: 2
    Incident: INC0011758 State: 1 Priority: 4
    Incident: INC0012278 State: 1 Priority: 3
    Incident: INC0013306 State: 1 Priority: 4

## GlideQueryCondition - addUserOrCondition(String name, String oper, Object value) {#ariaid-title7}

Appends a two-or-three parameter OR condition to an existing GlideQueryCondition.
Use this method to enforce query access based on the user.
This method returns only records that the current user has query access to (based on ACLs).

The addUserOrCondition() method works with the [GlideRecord addUserQuery()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addUserQuery_S_O_O "Provides the ability to build a request, which when executed, returns the rows from the specified table that match the request. The calling user must have access to perform the specified query operation on the field for this request to be added. Use this method to enforce query access based on the user.") method to `OR` the specified query parameters to the query previously constructed using addUserQuery().  
Related methods:

* [addOrCondition()](https://servicenow-prod.fluidtopics.net/AD69pEoBTofsaumFBhODsQ#r_ScopedGlideQueryConditionAddOrCondition "Appends a two-or-three parameter OR condition to an existing GlideQueryCondition.") provides the same functionality without ACL enforcement.
* [addSystemOrCondition()](https://servicenow-prod.fluidtopics.net/9xf9WUOMRTsGZ~dyEgotfw#GQC-addSystemOrCondition_S_O_O "Appends a two-or-three parameter OR condition to an existing GlideQueryCondition. Use this method to bypass query access.") bypasses query access checks.
{#GQC-addUserOrCondition_S_O_O__ul_i2h_csq_53c}  
Additional methods for enforcing query ACL checks:

* [addUserCondition()](https://servicenow-prod.fluidtopics.net/9xf9WUOMRTsGZ~dyEgotfw#GQC-addUserCondition_S_S_O "Adds an AND condition to the current condition. Use this method to enforce query access based on the user.")
* [GlideRecord - addUserEncodedQuery()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addUserEncodedQuery_S "Adds a query using an encoded query string. Use this method to enforce query access based on the user.")
* [GlideRecord - addUserOrderBy()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addUserOrderBy_S "Specifies an orderBy column. Use this method to enforce query access based on the user.")
* [GlideRecord - addUserOrderByDesc()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addUserOrderByDesc_S "Specifies a descending orderBy column. Use this method to enforce query access based on the user.")
* [GlideRecord - addUserQuery()](https://servicenow-prod.fluidtopics.net/kEnhxKeOH9ksdDjzH~63~A#GR-addUserQuery_S_O_O "Provides the ability to build a request, which when executed, returns the rows from the specified table that match the request. The calling user must have access to perform the specified query operation on the field for this request to be added. Use this method to enforce query access based on the user.")
{#GQC-addUserOrCondition_S_O_O__ul_znd_wlp_53c}
{#GQC-addUserOrCondition_S_O_O__table_vy2_625_jq__entry__3}

| Name | Type | Description |
|-|-|-|
| name | String | Field name |
| oper | String | (Optional) Query operator. The available values are dependent on the data type of the <var class="keyword varname">value</var> parameter. If you do not specify an operator, the condition uses an equals operator. Numbers: * = * != * \> * \>= * \< * \<= {#GQC-addUserOrCondition_S_O_O__ul_qyb_rbt_3y} Strings (must be in upper case): * = * != * IN * STARTSWITH * ENDSWITH * CONTAINS * DOESNOTCONTAIN {#GQC-addUserOrCondition_S_O_O__ul_egz_vbt_3y} |
| value | Object | Value on which to query (not case-sensitive). Note: All passed in arrays must contain a minimum of two elements. Single element arrays are not supported. |
[Table 11. Parameters]

{#GQC-addUserOrCondition_S_O_O__table_vy2_625_jq} {#GQC-addUserOrCondition_S_O_O__table_w2h_w2c_2r__entry__2}

| Type | Description |
|-|-|
| GlideQueryCondition | A reference to a GlideQueryConditon that was added to the GlideRecord. |
[Table 12. Returns]

{#GQC-addUserOrCondition_S_O_O__table_w2h_w2c_2r}  
To group AND/OR statements to make complex queries, such as getting 20 incidents with a (state less than 3 OR greater than 5) AND (priority is 1 OR priority is 5).

    var myObj = new GlideRecord('incident');
    var q1 = myObj.addUserQuery('state', '<', 3);
    q1.addUserOrCondition('state', '>', 5);
    var q2 = myObj.addUserQuery('priority', 1);
    q2.addUserOrCondition('priority', 5);
    myObj.setLimit(20);
    myObj.query();

    while (myObj.next()) {
      gs.info('Incident: ' + myObj.getValue('number') + ' State: ' + myObj.getValue('state') + ' Priority: ' + myObj.getValue('priority'));
    }

Output:

    Incident: INC0000001 State: 7 Priority: 1
    Incident: INC0000004 State: 7 Priority: 1
    Incident: INC0000012 State: 7 Priority: 5
    Incident: INC0000013 State: 7 Priority: 1
    Incident: INC0000024 State: 7 Priority: 5
    Incident: INC0000028 State: 7 Priority: 5
    Incident: INC0000031 State: 2 Priority: 1
    Incident: INC0000057 State: 7 Priority: 5
    Incident: INC0000057 State: 2 Priority: 5
    Incident: INC0000058 State: 7 Priority: 5
    Incident: INC0000058 State: 2 Priority: 5
    Incident: INC0000059 State: 7 Priority: 5
    Incident: INC0000060 State: 7 Priority: 5
    Incident: INC0000061 State: 7 Priority: 5
    Incident: INC0000062 State: 7 Priority: 5
    Incident: INC0000064 State: 7 Priority: 5
    Incident: INC0000065 State: 7 Priority: 5
    Incident: INC0000066 State: 7 Priority: 5
    Incident: INC0000069 State: 7 Priority: 5
    Incident: INC0000072 State: 7 Priority: 5


