(Jan-28-2020, 05:24 PM)buran Wrote: @snippsat - probably id is unique per message, while body may be repeateYes of course agree,so a turn around.
>>> record = {} >>> for item in json_data['messages']: ... record[item['id']] = item['body'] >>> record {4461048: 'Mnow test test', 4461049: 'test 9999', 4620511: 'test sms,test sms', 4620584: 'test sms', 4646648: 'test sms', 4646877: 'test sms', 4671891: 'test sms'} >>> record.get(4461049, 'Not in record') 'test 9999' >>> record.get(9999999, 'Not in record') 'Not in record'