
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2020 05:09 AM
Hello,
I want to display JSON data in UI Page.
The JSON looks like this:
For so long I wrote this
<?xml version="1.0" encoding="utf-8" ?>
<j:jelly trim="false" xmlns:j="jelly:core" xmlns:g="glide" xmlns:j2="null" xmlns:g2="null">
<g:evaluate>
var r = 'Outbound REST Message';
var request = new sn_ws.RESTMessageV2(r, 'get');
var response = request.execute();
var responseBody = response.getBody();
var obj = JSON.parse(responseBody);
</g:evaluate>
<j:forEach var = "jvar_get" items = "${obj.result}">
<p> ${jvar_get} </p>
</j:forEach>
</j:jelly>
I receive this.
[object Object]
[object Object]
[object Object]
[object Object]
[object Object]
How I can get access to every single one names ?
Solved! Go to Solution.
- Labels:
-
User Interface (UI)

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2020 05:54 AM
Hi,
you can access the data like this.
<j:forEach var = "jvar_get" items = "${obj.result}">
<p> ${jvar_get.name} </p>
</j:forEach>
</j:jelly>
Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.
Regards,
Asif
2020 ServiceNow Community MVP
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2020 05:24 AM
Hello Artur,
Try not parsing the responseBody into a JavaScript object. Like this:
var obj = responseBody;

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
02-25-2020 05:54 AM
Hi,
you can access the data like this.
<j:forEach var = "jvar_get" items = "${obj.result}">
<p> ${jvar_get.name} </p>
</j:forEach>
</j:jelly>
Kindly mark the comment as a correct answer and helpful if it helps to solve your problem.
Regards,
Asif
2020 ServiceNow Community MVP