Discussion
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Vodafone Intelligent solutions
IN
Last activity: 30 Oct 2015 6:28 EDT
How to Render JSON response from clipboard to UI ?
Hello Team,
I was trying to integrate Google Rest service which shows all the details regarding to the location, using following URL https://maps.googleapis.com/maps/api/geocode/json. I have achived the integration using Rest connector option from Integration tab and able to get the Response JSON on clipboard.
I have achived this by calling an activity on button click .
Now my requirement is to get the response on UI like Lattitude and Longitude:
This is a part of my POC and I am stucked on this part. Can anybody provide the step by step process for getting response from clipbord on UI.
Thanks,
Amit Goyal
-
Like (0)
-
Share this page Facebook Twitter LinkedIn Email Copying... Copied!
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Randstad Technologies US
US
you can use following code to create clipboard structure.then you can display them on UI using clipboard page a source for any control.
ClipboardPage stepPage=tools.getStepPage();
try
{
stepPage.adoptJSONObject(jsonResponse);
}
catch(Exception e)
{
throw new PRRuntimeException(e);
}
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Vodafone Intelligent solutions
IN
Hi Subba,
adoptJSONObject(jsonResponse) take argument as string so how should I pass my response which I am getting in webForm page on clipboard as JSON.
I have put this code in java method in an activity but it shows error : could not resolve jsonResponse
regards
Amit
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/3efcaba8-d4aa-490f-a489-fb6cbf28654c.jpg?h=f310b0d6&itok=JJS6L2Tq)
![](https://accounts.pega.com/sites/default/files/styles/user_image/public/2023-03/3efcaba8-d4aa-490f-a489-fb6cbf28654c.jpg?h=f310b0d6&itok=JJS6L2Tq)
Optus
AU
Hi Amit,
Declare the argument as a local variable will resolve the "could not resolve jsonResponse" error.
Regards,
Satish
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Randstad Technologies US
US
add one local veriable in activity as jsonResponse then
before java step,add one property-set method,
then set the value to jsonResponse from your webform.response_get property.
then it will work
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Vodafone Intelligent solutions
IN
Hi Subba,
I have tried the things you have told me to do but the issue is still there. I am posting some screen shots for more clarity.
Please help
As you told I have created a variable jsonResponse and passed the webform.response_get.default response in it.
then I have written the code which you posted
but it is showing this error
please provide detailed solution if possible
Regards
Amit Goyal
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Process 360
IN
Please make changes as shown in screenshot below to step 4
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Randstad Technologies US
US
you need to create jsonResponse as a local variable not a parameter
And you need to give step where you want to store the result of json response..then it will work.
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
![](/profiles/pega_profile/modules/pega_user_image/assets/user-icon.png)
Vodafone Intelligent solutions
IN
Thanks subba and Bhanu,
The error is resolved. Now can you please tell me how to map a control on UI to the clipboard page.
regards
Amit