Hi all, trying to write a Web Services After operation rule for after account aggregation. End goal is to read in a manager attribute, do some simple sting manipulation then put it onto the account for all accounts.
List list = new ArrayList();
List Finallist = new ArrayList();
Map account = new HashMap();
ArrayList accountList = new ArrayList();
if(null!=rawResponseObject){
Map jsonResultMap = (Map) JsonUtil.toMap(rawResponseObject);
List profiles = JsonUtil.get(jsonResultMap,"profiles");
//profiles currently has all users inside from raw get response
// Each iteration in this loop represents an account - pretty sure
for(int i=0;i < profiles.size(); i++){
Map itemJsonMap = JsonUtil.toMap(JsonUtil.toStringOrJson(profiles.get(i)));
String supervisor = itemJsonMap.get("attributes.assignment_manager").toString();
int firstP = supervisor.indexOf("(");
String managerEmail= supervisor.substring(firstP+1, supervisor.length()-1);
account.put( "managerEmail", "managerEmail");
accountList.add(account);
}
}
Map accountListMap = new HashMap();
accountListMap.put("data", accountList );
I have not been successful. This will not do anything. I even created a dumbed down version to try doing this statically and that wont work either. Any help is appreciated!
Map account = new HashMap();
Map accountListMap = new HashMap();
List accountList = new ArrayList();
log.error("##Start");
account.put("Manager Email", "[email protected]");
accountList.add(account);
accountListMap.put("data", accountList );
log.error("##end");
return accountListMap;
My thought is that we are putting my [email protected] to the account attribute “Manager Email” but it is not populating