AnsweredAssumed Answered

Need help concatenating email addresses returned in an array

Question asked by CyanX on Oct 17, 2014
Latest reply on Nov 19, 2014 by CyanX

Hello,

 

I am creating a process that needs to obtain the email address of the IS Coordinator for an end users’ cost center (affected_contact.billing_code.name) from Novell eDirectory.This is the process flow:

  1. Using Select Object, I am retrieving a list of attributes from SDM, one of them being the end users’ cost center (affected_contact.billing_code.name).
  2. Using Get Object, I am then retrieving the usernames of the IS Coordinators associated to that same cost center from Novell eDirectory, and storing then in “Process.Opids”.
  3. Using Get User, I then use the Opids to find the associated email address in Novell eDirectory, and store them in “Process.ISCEmail”.

 

Then I am using JavaScript to try to concatenate the email addresses, so I can in put them in the Send Email operator. Here is the code I’m using:

 

Process.ISCEmail = Process.Get_User_1.UserAccounts

 

//Define variable as an empty string

var email =  '';

 

//Loop through multiple email addresses

for (i = 0; i < Process.ISCEmail.length; i++) {

 

  //Add email addresses to string

  email += Process.ISCEmail.length[i];

 

  // Add colon separator,  Process.ISCEmail.length - 1 makes sure it doesn't add

  // the colon at the very end of the string

 

  if (i < ( Process.ISCEmail.length - 1)) {

                email += ";";

  }

}

 

Process.Email = email;



The process is failing, as Process.Email is coming back as “undefined;undefined”. I'm sure I'm doing something wrong. but I can’t determine where the code is wrong. Please assist. I have attached the process for reference, if needed. Thanks in advance.

Attachments

Outcomes