Skip to main content
nvalid conversion from runtime type List<ANY> to Map<String,ANY>

Http h = new Http();

HttpResponse res = h.send(req);

 Map<String,Object> resBody = (Map<String, Object>)JSON.deserializeUntyped(res.getBody());

List<String> fieldAPINames = new List<String>(); List<String> headerList = new List<String>();

String fieldQuery = 'SELECT ';

for(Object col : (List<Object>)resBody.get('columns')){

   Map<String, Object> colFieldMap = (Map<String, Object>)col;

   if((Boolean)colFieldMap.get('hidden') == false){

          headerList.add((String)colFieldMap.get('label'));

          fieldAPINames.add((String)colFieldMap.get('fieldNameOrPath'));

          if(fieldQuery == 'SELECT '){ 

                fieldQuery += (String)colFieldMap.get('fieldNameOrPath');

           }

          else

        {

            fieldQuery += ','+(String)colFieldMap.get('fieldNameOrPath');

         }

    }

}

Any help is appreciated 
2 answers
0/9000