---
title: "selectPages"
canonical: "https://support.appfire.com/space/PSCONF/15305104/selectPages"
format: markdown
---
> Macro (aura-html)

> Macro (table-plus)
> 
> |  |  |  |  |
> | --- | --- | --- | --- |
> | **Syntax** | selectPage(cqlQuery) | **Package** |  |
> | **Alias** |  | **Pkg Usage** |  |

## Description

> Macro (excerpt)
> 
> Returns an array with the IDs of the pages that match the search query.

Returns an array with the IDs of the pages that match the search query.

## Parameters

> Macro (table-plus)
> 
> | Parameter name | Type | Required | Description |
> | --- | --- | --- | --- |
> | CQL query | String | Yes | Confluence Query Language (CQL) search string. |

## Return Type

**Number []**

Returns a list of page IDs that match the specified CQL.

## Example

```javascript
string cql = "(type=page and Space=DEV) OR (creator=bobsmith and type=blogpost)";
number [] pages = selectPages(cql);
for(number p in pages) {
	%p%.labels += "newLabel";
}
```

## See also

> Macro (contentbylabel)