There are three main approaches to removing elements from a Page list based on specific values
Approach 1: Using For Each Page In with Remove Action
This approach iterates through each page in the list and removes items that match your criteria:
- Create or open your Data Transform rule.
- Add a For Each Page In action.
- Add a When condition inside the For Each action.
- Inside the condition, set the .pyDeletedObject to true.
- Call the @RemoveDeletedObject(MyPageList) outside the For Each loop
Note: .OperatorList is a Page List
Approach 2: Creating a New Filtered List (I know this not a ‘remove’, but the result is a list without the items you wanna remove)
This approach creates a new list with only the items you want to keep:
- Create or open your Data Transform rule.
- Add a For Each Page In action.
- Add a When condition inside the For Each action.
- Inside the condition, set the current page to a new page list.
Variation: Filter Results Directly on the Source
One variation is to filter the results directly on the source:
- Select the action Append to.
- Fill the empty list target and set the relation to each page in.
- Click the small icon and fill the popup Conditionally Append Source to filter directly in the origin.
Approach 3: Using the Remove Action Directly (For Simple Cases)
For more straightforward scenarios where you know the exact index of the item to remove:
NOTE: This operation removes a single page from the page list, precisely the page at the last index where the specified condition is met within the loop.
- Create or open your Data Transform rule.
- Add a For Each Page In action.
- Add a When condition inside the For Each action.
- Set a parameter with the index to remove inside the condition.
- Outside the For Each loop, select the remove action and set the target to the list index.
References:
• Pegasystems Documentation
• Pegasystems Documentation
• https://academy.pega.com/topic/data-management





