Question

How JSON As Simple File Coming to PRPC from File Listner can be Parsed

Dear All,

We are having a Proposal from Client that we need to Read a File . ==> OK

The file will be Read through the File Listner ==> OK

The File will contain JSON each and every time with a Response Structure ==> OK

But after we Receive the file in the PRPC we need to process/parse the same in PRPC to extract the Information out of it. ==> NOT OK

(WHY NOT OK : We have Implemented CSV Files or the XML Files Parsing which we receive from the File Listners But how can we parse the JSON, is there a way of achieving it with some OOTB activities which Reads JSON FIle format and give us a Clipboard page , as the same happens in the Case of the CSV files or XML Files.) ???? That is my question.

**Moderation Team has archived post**

This post has been archived for educational purposes. Contents and links will no longer be updated. If you have the same/similar question, please write a new post.

Correct Answer
November 21, 2016 - 8:09am

 

Solution :

On my Initial analysis the JSON Parsing without Rest from the File is possible. Please see the below explanation .

 

  1. Use the Activity

  2. For Example I have taken the Sample JSON from http://www.w3schools.com/js/js_json_intro.asp

{"employees":[
    {"firstName":"John", "lastName":"Doe"},
    {"firstName":"Anna", "lastName":"Smith"},
    {"firstName":"Peter", "lastName":"Jones"}
]}

      3.The Same Json has been Passed to the Parameter. And the Result was good and successful in Tracer.

      4.The Page Structure which got created is given below :

 

 

Resultant Page :

Comments

Keep up to date on this post and subscribe to comments

November 17, 2016 - 9:00am

JSON* Typo.. :)

November 21, 2016 - 8:09am

 

Solution :

On my Initial analysis the JSON Parsing without Rest from the File is possible. Please see the below explanation .

 

  1. Use the Activity

  2. For Example I have taken the Sample JSON from http://www.w3schools.com/js/js_json_intro.asp

{"employees":[
    {"firstName":"John", "lastName":"Doe"},
    {"firstName":"Anna", "lastName":"Smith"},
    {"firstName":"Peter", "lastName":"Jones"}
]}

      3.The Same Json has been Passed to the Parameter. And the Result was good and successful in Tracer.

      4.The Page Structure which got created is given below :

 

 

Resultant Page :

November 21, 2016 - 8:11am

The Activity Name is ParseJSON. It is available in Pega Marketing Class. it does have a Java Step which does the magic.