Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Infosys
IN
Last activity: 8 May 2024 5:04 EDT
How to check the index of the page list in a when condition in Datatransform
My scenario:
ClaimDataPage.ClaimData.CustomerStatusLis()... I need to find whether the subscript of pagelist CustomerStatusList()> 1, then Set Customer status is equal to previous status else blank
-
Reply
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Updated: 8 Apr 2024 6:52 EDT
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/7359511c-586a-494f-8aa8-c3e689fc3d56.png?h=0485d92b&itok=g3VHcbsI)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/7359511c-586a-494f-8aa8-c3e689fc3d56.png?h=0485d92b&itok=g3VHcbsI)
Maantic Technologies Pvt Ltd.
IN
Iterate over the page list ClaimDataPage.ClaimData.CustomerStatusLis() in your data transform or activity and use the pre condition as
.pxListSubscript>1 / Param.pyForEachCount>1
If true continue whens or skip step
In the step set the value of CustomerStatus based on your requirements
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/7359511c-586a-494f-8aa8-c3e689fc3d56.png?h=0485d92b&itok=g3VHcbsI)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/7359511c-586a-494f-8aa8-c3e689fc3d56.png?h=0485d92b&itok=g3VHcbsI)
Maantic Technologies Pvt Ltd.
IN
If you are iterating on the pagelist then you can use Param.pyForEachCount.
Alternatively you can also use property pxListSubscript to evaluate your when condition.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Infosys
IN
@SrijitaB if I use pxListSubscript in a when Condition , what exactly has to be used to refer the pagelist which am looking for... ClaimDataPage.ClaimData.CustomerStatusLis()
Accepted Solution
Updated: 8 Apr 2024 6:52 EDT
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/7359511c-586a-494f-8aa8-c3e689fc3d56.png?h=0485d92b&itok=g3VHcbsI)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/7359511c-586a-494f-8aa8-c3e689fc3d56.png?h=0485d92b&itok=g3VHcbsI)
Maantic Technologies Pvt Ltd.
IN
Iterate over the page list ClaimDataPage.ClaimData.CustomerStatusLis() in your data transform or activity and use the pre condition as
.pxListSubscript>1 / Param.pyForEachCount>1
If true continue whens or skip step
In the step set the value of CustomerStatus based on your requirements
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
700Apps
SA
sample when Condition :
D_GetRole[UserID:OperatorID.pyUserIdentifier,Role:@pxEvaluateDecisionTable(Param.PageListProperty+"("+.pxListSubscript +")","ABC").pxResults(1).myRecord
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/0616cffa-1530-4cde-abff-fac83e4635bf.jpg?h=658174c2&itok=sY2fYdoO)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/0616cffa-1530-4cde-abff-fac83e4635bf.jpg?h=658174c2&itok=sY2fYdoO)
Maantic Inc
IN
In the data transform while looping through the pagelist ClaimDataPage.ClaimData.CustomerStatusLis(), run a when rule/expression where you check .pxListSubscript>1 or Param.pyForEachCount>1. If the result is true then set your required value.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Infosys
IN
.pxListSubscript>1 do we need to declare something else, this when condition always set to false even when there are CustomerStatusList(1),CustomerStatusList(2),CustomerStatusList(3) are present
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/7359511c-586a-494f-8aa8-c3e689fc3d56.png?h=0485d92b&itok=g3VHcbsI)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2024-03/7359511c-586a-494f-8aa8-c3e689fc3d56.png?h=0485d92b&itok=g3VHcbsI)
Maantic Technologies Pvt Ltd.
IN
You have to use this in context of the pagelist, meaning you have to use the condition inside a loop iterating over the pagelist.
In case .pxListSubscript is not working, try Param.pyForEachCount and see if the pre condition works.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Infosys
IN
It worked with Param.pyForEachCount.
Thanks