Question
NCS Group
SG
Last activity: 19 Mar 2018 9:26 EDT
How to retrieve the first element of Data Page inside a Data transform
How to retrieve the ".Code" property of the first instance of a Data Page(List). I tried following expressions, it doesn't seems to work.
D_ABCList[].pxResults(1).Code
D_ABCList(1).Code
@getProperty????
illustration in Java
//Assuming ArrayList ABC;
return abc.get(0).Code;
***Moderator Edit: Vidyaranjan | Updated Categories***
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
Accepted Solution
LTI
IN
Hi,
In Pages and Classes , we can put page name as 'D_ABCList.pxResults' and Class should be Data page's Object type 'Data-ABC'. Then rule is saved. We can access first element by D_ABCList.pxResults(1).Code, if data page doesn't have any parameters.
Thanks.
Pegasystems Inc.
IN
Hi,
Try D_ABCList.pxResults(1).Code
Make sure to include the class of datapage in pages and classes tab of data transform.
Alternative:
Hi,
Try D_ABCList.pxResults(1).Code
Make sure to include the class of datapage in pages and classes tab of data transform.
Alternative:
You can copy the all results from datapage into a pagelist property using a datatransform and get the first result from that pagelist.
eg: TestPageList(1).code
This should work.
Thanks.
NCS Group
SG
Hi, thanks for reply, I have tried "D_ABCList.pxResults(1).Code" and put "D_ABCList: Data-ABC" in the Page & Classes tab
Then It returns "Source—Property @baseclass.Code is undefined." Error.
Do you have any clue why it happen?
Accepted Solution
LTI
IN
Hi,
In Pages and Classes , we can put page name as 'D_ABCList.pxResults' and Class should be Data page's Object type 'Data-ABC'. Then rule is saved. We can access first element by D_ABCList.pxResults(1).Code, if data page doesn't have any parameters.
Thanks.
NCS Group
SG
Yes, problem solved, Thank you so much for your detailed explanation!
Pegasystems Inc.
IN
Hello ,
You can access the page list with pxresults and then access the property something like this below
pagelist.pxResults(count).code .
Thanks,
Arun
Areteans Tech
AU
Let us know , if this works
-
NagaRamesh Thirlaka
Self
US
What if the Data Page does have parameters?
jsp tags like <pega:reference/> or <pega:withPage/>, etc., don't seem to like the D_DataPageName[ParameterName:"value"] syntax ... how can one access parameter-ized data pages from jsp tags?