Question
Tata Consultancy Services
IN
Last activity: 7 Mar 2017 2:03 EST
Compare a property value in 2 different pagelists of same class
Hi, I have a requirement where I need to check if a property value in pagelist1 is in any page of Pagelist2. Please note that both the pagelists are of same class and I need to check the same property value in both the pagelists if they are same or not.
Is there any OOTB function to verify this ?
EX:- P1.a1, P2.a1 properties are of page list 1 and I need to check if these property values are in P2.a1, P2.a1, P3.a1, P4.a1
***Updated by moderator: Lochan to add Categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
Pegasystems Inc.
US
Hello,
In that case, I think you'll probably want to do the evaluation ahead of time and set a boolean property that your when rule can look at to decide if the section meets your visibility criteria.
Thanks,
Mike
Pegasystems Inc.
US
Hello,
The easiest way would be to iterate through Pagelist1 and within the iterator, iterate through Pagelist2 to compare. Obviously, this doesn't scale, so if you have really large pagelists, you might want to get more creative. In that case, we can start asking questions like, will value of a1 be repeated, or if you find a match, can you remove the entire page from Pagelist2 from consideration? If so, you might be able to use things like page-remove to prune the list as you go. Assuming you don't need Pagelist2 later. That said, I'm not aware of any OOTB functionality to do this comparison for you, so one way or another I think you'll need to build it yourself.
Thanks,
Mike
Tata Consultancy Services
IN
Thanks Mike for your response, I have already implemented using an activity and looping through it. I just want to know if there is any OOTB function which has that capability.
Tech Mahindra Ltd
CA
You can use OOTB function IsInPageList for page list2 to verify the value is there or not in entire page list2 without looping..
Pegasystems Inc.
US
You could use a data transform to iterate the first list
Within each iteration call OOTB @Default.IsInPropertyCollection().
An Integer Parameter can be used to count the number of times a match was found. EX:
Set Param.Count = @Default.IsInPropertyCollection(.LookAtProp, .OtherPageList) ? Param.Count + 1 : Param.Count
Tata Consultancy Services
IN
Thanks guys for your responses. Actually, I can't use an activity or datatransform as I need to use this in a when rule as a visibility condition so I wanted to know if there is any OOTB function to compare both the pagelist values.
Accepted Solution
Pegasystems Inc.
US
Hello,
In that case, I think you'll probably want to do the evaluation ahead of time and set a boolean property that your when rule can look at to decide if the section meets your visibility criteria.
Thanks,
Mike
Tata Consultancy Services
IN
Thanks Mike !