Get values out of a JSON list of objects with Apex code

Get values out of a JSON list of objects with Apex code -


List<Object> fieldList = (List<Object>)JSON.deserializeUntyped('[{"field":"phone","object":"account"},{"field":"name","object":"account"}]');

for(Object fld : fieldList){    

    Map<String,Object> data = (Map<String,Object>)fld;

    system.debug(data.get('field'));

}

Comments