Group Aggregation Issue

Hi All,

Can anyone give any solution for reading groups if they are in the below format using after rule

typimport java.io.StringWriter; 
import java.text.SimpleDateFormat; 
import sailpoint.tools.GeneralException; 
import com.google.gson.Gson; 
import org.json.*; 
import sailpoint.integration.*; 
 
 
List list = new ArrayList(); 
Map response = new Gson().fromJson(rawResponseObject, Map.class); 
 
List Finallist = new ArrayList(); 
log.info(\"Get raw response\"+response); 
 
list = response.get(\"resources\"); 
log.info(\"get List\"+list); 
 
    for(int d = 0; d < list.size(); d++ ){ 
      Map responseMap = (Map) list.get(d); 
 
 
        Map newmap = new HashMap(); 
        newmap.put(\"id\", responseMap.get(\"id\")); 
       Finallist.add(newmap); 
  } 
 
Map updatedMapInfo = new HashMap(); 
updatedMapInfo.put(\"data\", Finallist); 
log.info(\"Get Final List\"+Finallist); 
 
return updatedMapInfo; 
    

I am trying with the above sample code but facing issues

Why are you using get in this format? Because as per example it should be a string. Is it that group will be in expanded format and just for the case of showing you did not expand it?

Also, if possible, please share error that you are getting.

Thanks

Could you try storing the group as a String instead of a Map to pass it directly in the newmap

String response = list.get(d);

newmap.put(\“id\”, response);

1 Like

This topic was automatically closed 60 days after the last reply. New replies are no longer allowed.