My attempts to create a function that verifies if app.account_username matches a username in a json array are just leading me in circles.
This is how the json array is structured
{
"data": {
"id": 32607158,
"with_account": "user1",
"with_account_id": 8483786,
"last_message_preview": "XD",
"message_count": 289,
"messages": [{
"id": 153359194,
"from": "user1",
"account_id": 20094939,
"sender_id": 8483786,
"body": "*hugs*",
"conversation_id": 32607158,
"datetime": 1439711004
}, {
"id": 153359270,
"from": "user2",
"account_id": 20094939,
"sender_id": 20094939,
"body": "*hugs*",
"conversation_id": 32607158,
"datetime": 1439711023
}, {
"id": 153359330,
"from": "user1",
"account_id": 20094939,
"sender_id": 8483786,
"body": "*hugs*",
"conversation_id": 32607158,
"datetime": 1439711044
}, {
"id": 153359334,
"from": "user2",
"account_id": 20094939,
"sender_id": 20094939,
"body": "*hugs*",
"conversation_id": 32607158,
"datetime": 1439711048
}, {
"id": 153359386,
"from": "user1",
"account_id": 20094939,
"sender_id": 8483786,
"body": "*hugs*",
"conversation_id": 32607158,
"datetime": 1439711057
}, {
"id": 153359430,
"from": "user2",
"account_id": 20094939,
"sender_id": 20094939,
"body": "*hugs*",
"conversation_id": 32607158,
"datetime": 1439711065
}, {
"id": 153359474,
"from": "user1",
"account_id": 20094939,
"sender_id": 8483786,
"body": "*hugs*",
"conversation_id": 32607158,
"datetime": 1439711078
}, {
"id": 153359522,
"from": "user2",
"account_id": 20094939,
"sender_id": 20094939,
"body": "*hugs*",
"conversation_id": 32607158,
"datetime": 1439711090
}, {
"id": 153359638,
"from": "user2",
"account_id": 20094939,
"sender_id": 8483786,
"body": "*hugs*",
"conversation_id": 32607158,
"datetime": 1439711106
}],
"done": false,
"page": 2,
"datetime": 1439711387
},
"success": true,
"status": 200
}
I'm attempting to compare "from" with "app.account_username", but I could use some guidance on how to accomplish this. Does anyone have any ideas?