Question

How do I compare values in one pagelist to another?

Hi,

I am configuring a when rule that will return true if values in one pagelist match in another and false if there were no matches, but I need some guidance on this. Right now I am using the IsInPageList function that takes three parameters: lookFor, lookAt, and lookIn.
-For lookFor, I want to use <current-value> to loop through one pagelist and extract the property to be compared, however current-value returns an error. I cannot hard code indexes because the size of the pagelist varies.
-For lookAt, I specified the property to be compared in the pagelist specified in the next param
-For lookIn, I put the pagelist name

You are greatly appreciated!

Correct Answer
July 27, 2018 - 10:10am

To compare 2 pagelists, 

In an activity or data transform, first iterate over pagelist - within this iteration call isInPageList function. To the function you can pass the value of the property you want to search. 

As you would be in loop, you need not mention current or page list index, it will automatically get the property from step page context.

For lookfor param - you can give a property defined in the pagelist you are iterating and which you want to compare

lookAt- which property in pagelist2 you want to compare

Comments

Keep up to date on this post and subscribe to comments

Pega
July 27, 2018 - 10:10am

To compare 2 pagelists, 

In an activity or data transform, first iterate over pagelist - within this iteration call isInPageList function. To the function you can pass the value of the property you want to search. 

As you would be in loop, you need not mention current or page list index, it will automatically get the property from step page context.

For lookfor param - you can give a property defined in the pagelist you are iterating and which you want to compare

lookAt- which property in pagelist2 you want to compare

July 27, 2018 - 11:24am
Response to vanaa

Hi vanaa!

Thanks for answering. Is there any way to do this check strictly using just a single when rule?

Pega
July 30, 2018 - 12:11am
Response to SamL84

Write a RUF, rule utility function and refer it in when rule. In RUF write logic for comparison.

July 28, 2018 - 12:53am

hello,

Can we not use below approach to meet your requirement.. Please have a look and share your thoughts,

- Utilize OOTB pxCompareTwoPageLists activity to determine elements added/deleted ..

- build a simple when rule to capture changes and return true/false based on outcome.

Reference OOTB Rule: 
pzSetHistoryMemoForCaseConfig (step#1-3)

July 30, 2018 - 8:24am
Response to RahulGhosh

Hi RahulGhosh,

I should have also mentioned that I am looping through one pagelist and only require one match in the other. ie. A list of valid codes

July 28, 2018 - 2:57am

Please iterate through the pagelist inside that use isInPageList function to compare.

July 30, 2018 - 1:07am
Response to Raveendra

Did it help.

Please let me know if you need any help

July 30, 2018 - 8:29am
Response to Raveendra

Hi Raveendra,

Could you provide a help link for the IsInPageList function? Or explain what each parameter is and what should go in them?

Thanks a bunch!

July 28, 2018 - 11:42am

Could you please try with IsInPageList function by looping through the page list

Pega
December 13, 2018 - 4:55am

try function pxComparePages--(ClipboardPage,ClipboardPage,String).

This Function compares two clipboard pages and returns a Code-Pega-List page of differences.

You can use the activity pxComparePages 

if you have pzInsKeys of the records to compare, use the activity pxComparePagesByKey.

August 5, 2019 - 5:38am

So this is how it's done easily. I've used two when rules already attached with the comment.

it compares the two pages by the parameter count(where count is incremented by 1 every time) for comparing side by side  and then for the last when rule if the second page list size is greater than the first one, for that I used the logic of whether the last exceeding index value is blank or not. If blank then the result is true else you know the result! ;)