You need to sign in to do that
Don't have an account?
Aruna
Invalid conversion from runtime type List<ANY> to Map<String,ANY>
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
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
at which line were you getting this error.
Thanks,
karthik
Can you try something like below to parse the response,
Now iterate over the resultlist in for loop.
If this solution helps, Please mark it as best answer.
Thanks,