Question
IBM
CN
Last activity: 6 Feb 2023 3:52 EST
How to access 1st level page in a two level for "each page" loop
in a two level for "each page" loop, How to access 1st level page in 2nd level loop?
assume a, b are both page list, in below, "Also use each page as source context" checked box are checked
For Each Page in a
For Each Page in b
here we can access properties in b, but how to can access properties in a?
@MaxonL16591286
You can make use of OOTB pxGetStepPageReference() function for this scenario, inside 1st for each page in loop by using the function you could get the page context in parameter. This parameter will hold the current iteration list page context value,
Define the parameter in parameter tab and page and class tab.
Inside 2nd loop directly you can refer the parameter page and get the 1st loop list values.
Please refer the attached screenshot. For attached screenshot example after 1st for each page loop completed Param.ParentListPageContext will be ParentList.pxResults(1),