Here’s an example where I’m only pulling in a single attribute “groupId”. In this case it’s the second step of an account aggregation process in which we are only pulling in a list of group Id’s associated with each user:
Map newMap = new HashMap();
List newList1 = new ArrayList();
for(Map m : processedResponseObject) {
if(m.get("groupId") != null) { newList1.add(m.get("groupId")); }
}
newMap.put("groupId", newList1);
processedResponseObject = new ArrayList();
processedResponseObject.add(newMap);
Map returnMap = new HashMap();
returnMap.put("data", processedResponseObject);
return returnMap;