Question
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Accenture
AU
Last activity: 7 Nov 2022 5:45 EST
How to test pega.api.ui.actions.getDataPage?
I need to test what the above javascript api return. I have created a test activity with two steps, Java steps and Show-Property. I enter the following in the Java step:
var options = { name: "dataPageName", parameters: [{name: "param1", value: "Page1.prop1", isProperty: true}, {name: "param2", value: 123, isProperty: false}], callback: callbackFunc, event: eventObject }; function callbackFunc(resultJSON){ console.log(resultJSON) } pega.api.ui.actions.getDataPage(options);
With our data page name and properties of course. However, it keeps throwing syntax error such as expecting characters ":", delete character "[", Syntax error on token "function", ClassInstanceCreationExpressionName expected etc.. so I'm just wondering if this is the correct way to test? if not are there any other way to simply pass data page parameters, call the function and see the results?
***Edited by Moderator Marije to add Capability tags***