How can i read json data
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 01:14 AM
{
"jobs": [
{
"details": {
"code": "123"
},
"userinfo": [
{
"user": "test"
},
{
"user": "abc"
}
]
}
]
}
above is the sample JSON i have. using above json how can i get user details.
5 REPLIES 5
Options
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-15-2024 01:36 AM - edited 03-15-2024 01:39 AM
i written like this in API but not working. i need to map users with different variables.
var details = request.body.data;
details.jobs.forEach(function(job) {
job.userinfo.forEach(function(user) {
gs.info('123456: ' +user.user);
});
});