# check page group in a when rule

**URL:** <https://forums.pega.com/t/check-page-group-in-a-when-rule/8821>\
**Category:** Blueprint and App Design\
**Tags:** enterprise-application-development, 8-8-3, pega-platform\
**Created:** [January 7, 2025, 5:33pm UTC](https://forums.pega.com/t/check-page-group-in-a-when-rule/8821 "2025-01-07T17:33:36Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MaxonL16591286](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@MaxonL16591286](https://forums.pega.com/u/MaxonL16591286)\
**Post date:** [January 7, 2025, 5:33pm UTC](https://forums.pega.com/t/check-page-group-in-a-when-rule/8821/1 "2025-01-07T17:33:36Z")

</div>

may I know how to check page group in a when rule?

hope to check each page in the page group to determine the output.

I can do same on page list by a few functions, like:

- page list contain a page where…

- page list does not contain a page where…

etc.

but seems they do not work on page group.

I do not want to list each page of the page group by specify their index one by one.

---

<div class="post-metadata">

**Author:** ![bretw](https://yyz2.discourse-cdn.com/pega/user_avatar/forums.pega.com/bretw/32/5941_2.png) [@bretw](https://forums.pega.com/u/bretw)\
**Post date:** [January 7, 2025, 6:37pm UTC](https://forums.pega.com/t/check-page-group-in-a-when-rule/8821/2 "2025-01-07T18:37:45Z")

</div>

@MaxonL16591286Unfortunately, **When rules** do not provide a direct function to check all entries of a **Page Group** like they do for a **Page List** ​​​​​​. Where are you trying to use this when rule? You could perhaps use a **Data Transform** before the when rule initiates to iterate over each entry in the **Page Group** and then use that property in the when rule.

```auto
For Each Page in <PageGroup> 
   If (<Condition>)
      Set .FlagForCondition = true
      Exit Iteration

```

Then, in the **When** rule, simply check if .FlagForCondition = true

---

<div class="post-metadata">

**Author:** ![MaxonL16591286](https://avatars.discourse-cdn.com/v4/letter/m/eb9ed0/32.png) [@MaxonL16591286](https://forums.pega.com/u/MaxonL16591286)\
**Post date:** [January 8, 2025, 5:09am UTC](https://forums.pega.com/t/check-page-group-in-a-when-rule/8821/3 "2025-01-08T05:09:42Z")

</div>

@bretw thanks.

I will use the when rule in field visibility so there’s no where to run a DT first.

So I have to list each page of the page group by specify their index one by one in the when rule.

Thanks.
