Get next object in an array by property value
HTML
<textarea id="result"></textarea>
CSS
textarea {
width:300px;
height:300px;
}
JavaScript
$(function() {
var SelectedUsers = [
{
"conflicts": [
[
{
"topic": null,
"seqNum": 1,
"tagItems": "",
"desired": null,
"isAction": 0,
"actionStatus": "null",
"participants": "null",
"prior": 1,
"isKey": 0,
"tx": 1,
"modification": "UPDATE",
"createdBy": 374,
"eventId": 2358,
"eventNote": "fgdddgdfhdfhfd xfhfhf dfhfhfh fhfhf",
"isProf": 0,
"lastUpdatedBy": 374,
"current": null,
"actualclosedDate": null,
"lastUpdatedDate": "2015-10-07 10:48:16",
"createdDate": "2015-10-06 17:58:12",
"dueDate": "null",
"responsibility": null
},
{
"topic": null,
"seqNum": 1,
"tagItems": "",
"desired": null,
"isAction": 0,
"actionStatus": "null",
"participants": "null",
"prior": 1,
"isKey": 0,
"tx": 0,
"eventId": 2358,
"createdBy": 65,
"eventNote": "hello",
"isProf": 0,
"lastUpdatedBy": 374,
"current": null,
"actualclosedDate": null,
"lastUpdatedDate": "2015-10-07 10:58:16",
"createdDate": "2015-10-06 17:58:12",
"dueDate": null,
"responsibility": null
},
"notes"
]
],
"eventId": 2358,
"eventName": "Ashba ahb h a ds"
}
]
;
var CurrentUser = SelectedUsers[0];
//var NextUser = //?
//var PreviousUser = //?
$("textarea")
.html(JSON.stringify(SelectedUsers[0].conflicts[0])
.replace(/\,/g,",\r\n"));
});