How can we delete a Page inside the page list based on condition?

How can we delete a Page inside the page list based on condition?

Hi @DolluM39,

we can achieve this by using data transform and activity.

  1. In data transform, Use the For Each Page In method to loop all pages in the page list, In that child add when condition, If the condition is true then add the child step Remove the current page. In the Remove step use the page as".MyPageList[]".

  2. In Activity, Loop the Page list, in that child, step add when condition, and in that step use the Page-Remove method to Delete/remove the current page. In this Page-remove step use the page index as" MyPageList()".

Hi @DolluM39,

You can follow this approach:

  1. Iterate over the list.
  2. Mark the pages you want to remove by setting pyDeletedObject to True.
  3. After iterating over the list, invoke the rule @Utilities.RemoveDeletedObjects(<PageList>).

The reason your current approach isn’t working is because the internal iterator object for the list can’t handle the list being changed while you’re removing pages.