Showing posts with label Pega Expression. Show all posts
Showing posts with label Pega Expression. Show all posts

Sunday, 19 April 2020

Page List expression Part 2

Hi Friends, In this post we will see below Page List expression.


PDN help:

https://community.pega.com/sites/default/files/help_v718/definitions/p/pagelist.htm



IsInPageListWhen(whenName, lookIn) -  this expression will return true when any one of the pages in page list  evaluates to true. 


Below is the list of instance in Courses table.



Now when we have to use this expression?

If our requirement is to find  any records having department as engineering  then we can use this expression.

How we can do that.

In the when rule we can check .Department = "Engineering"


Activity:



Obj-Browse: to browse list of records from Course table.



In the property set added the expression to check any pages have the match.



Now the above expression will become true when any pages data evaluates to true against the when rule CheckInPage.

When rule: CheckInPage




Now run the activity and check the result in Tracer.



In tracer we can able to see total 10 records retrieved from table. then the when rule become true.


So lets check the parameter(RetValue) in Parameter Page.



Value is true in Tracer.

So this expression completed.

---- **** -----


IsInPageList(lookFor, lookAt, lookIn) - This expression will provide return value true/false.

LookIn -  pagelist name in which we have to check.
LookAt- Property in Page.
LookFor- which value we have to check in the property.


In Page List CourseList.pxResults we are checking any pages having department = engineering.
In tracer we can able to see the parameter value as true.


Other expression we will see in next post. If you have any doubt ask in comment.😊

Thursday, 26 March 2020

Count In Page List Pega expression


Count In Page List Pega expression

Hi Friends, today we will practice the Page List expression provided in the below Pega help URL.

https://community.pega.com/sites/default/files/help_v718/definitions/p/pagelist.htm

Wrote a sample activity in work class to browse the list of pages from Courses data class.



Courses Data table


countInPageList(LookFor, LookAt, LookIn)


This expression will provide the Match count . 

LookIn- PageList name in which we want to search.
LookAt- which property we have to search for value.
LookFor - Value what we have to search in the Property.


Now If I want to get the Number of records having Hours = 2 , then I will use this expression .
 



From the table we can see for 4 records hours is 2.

In Property-Set added expression to get the count of pages which having hours 2.

Value will return in Count Parameter.


Lets run the activity and check the result in Parameter page.

Activity ran and traced 


In Event Line 7, we will check the parameter page.

We can see the result as 4 in Count Parameter.

countInPageListWhen(WhenName, LookIn)


This expression little bit same as above expression. 

WhenName - We can use the when condition to evaluate the data in the Current Page of PageList.
                       If the when condition becomes true then count will increase by 1.

LookIn- PageList name in which we want to search.


In acitivity added the expression, If when condition SalesDepartment becomes true then count will increase by 1.




When Condition

This when condition becomes true when current page in page list have department contains Sales.

Lets run the activity and check it.

In the tracer we can see when condition became true for record 9 and 10. So Count should be 2.


Result:

Count is 2.



other expression will see in next post. Ask in comment if you have any doubt😊