Validate two pagelists in a common workpage simultaneously

I have this requirement where validation of properties of a pagelist depends on values in another pagelist joined by the same parent page.

So, I have the following situation:

  • pyWorkPage
    • PageListOne()
      • Type
      • LinkedPages()
        - IndexInTwo
    • PageListTwo
      • Color

In case PageListOne().Type == Car, I need to check for every LinkedPages() whether .PageListTwo(IndexTwo).Color matches “Black”.

This should happen in a flow validation, so we 're running on the main page (pyWorkPage). I can have validate rules on PageList iterations, but I can’t figure out how to reference/validate stuff in another sybling pagelist (in this case PageListTwo), depending on what I encounter in PageListOne.

In case .PageListOne(1).Type = “Car”, the Color in .PageListTwo(1).

@Joris Claus ou can achieve this by creating a validation rule in an activity or data transform. First, iterate over PageListOne - within this iteration, check if the Type property equals “Car”. If it does, get the IndexInTwo property and use it to access the corresponding page in PageListTwo. Then, check if the Color property in PageListTwo matches “Black”. If it doesn’t, set a validation error. This approach allows you to validate properties in one pagelist based on values in another pagelist.

:warning: This is a GenAI-powered tool. All generated answers require validation against the provided references.

How to validate a Pagelist/Pageproperty in Pega

How do I compare values in one pagelist to another?