Question
Health First
US
Last activity: 5 Aug 2019 5:38 EDT
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!
-
Likes (1)
chukannagari sravani -
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
IN
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
-
Salvador Campos
Health First
US
Hi vanaa!
Thanks for answering. Is there any way to do this check strictly using just a single when rule?
Pegasystems Inc.
IN
The Bank of Nova Scotia
CA
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)
-
Venkateshwar Thipparthi Robert Wilt
Health First
US
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
CollabPartnerz
IN
CollabPartnerz
IN
Did it help.
Please let me know if you need any help
Health First
US
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!
CollabPartnerz
IN
Could you please try with IsInPageList function by looping through the page list
Pegasystems Inc.
IN
Hi,
Please refer below two links. It may help you.
https://community1.pega.com/community/pega-product-support/question/compare-2-page-list-properties
https://collaborate.pega.com/question/do-we-have-any-api-compare-values-pagelist
TCS
GB
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.
Capgemini India PVT Ltd
IN
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! ;)
-
Eswaraiah Kundabasetty Manikanta Manda Saurabh Patil