Skip to main content

This content has been archived and is no longer being updated. Links may not function; however, this content may be relevant to outdated versions of the product.

Support Article

connect-http rule to transfer data in the form of JSON

SA-1231

Summary



How to transfer data in the form of JSON in pega 6.1 using connect-http.


Resolution



Following is the explanation for usage of 'getPageAsJson' funciton in PRPC (till 6.3 SP1)


The below code will give the string which will have JSON of the page "pgpage".
Properties of the page with values will be in JSON format.


ClipboardPage pgpage=tools.findpage("<clipboard page>");
resultJSON= pea_rules_page.getPageAsJson(pgpage,null);

If idea is to only show some property from the page then, we can make the arraylist of those properties.
Eg:
java.util.ArrayList pgField= new java.util.ArrayList();
pgFields.add("<property name in the page>");

resultJSON= pea_rules_page.getPageAsJson(pgpage,pgFields);

The above will only give JSON with mentioned property.

If you wish to get the pagelist value, you need to add that in the pgField
pgField.add("<pagelist.property Name>");
resultJSON= pea_rules_page.getPageAsJson(pgpage,pgFields);



 
Suggest Edit

Published January 31, 2016 - Updated October 8, 2020

Did you find this content helpful? Yes No

Have a question? Get answers now.

Visit the Collaboration Center to ask questions, engage in discussions, share ideas, and help others.

We'd prefer it if you saw us at our best.

Pega Community has detected you are using a browser which may prevent you from experiencing the site as intended. To improve your experience, please update your browser.

Close Deprecation Notice
Contact us