PrevPrev Go to previous topic
NextNext Go to next topic
Last Post 05/18/2020 3:25 PM by  Joan Herzfeldt
Data manipulation and Emails in IPA
 2 Replies
Sort:
You are not authorized to post a reply.
Author Messages
Joan Herzfeldt
Private
Private
Veteran Member
(183 points)
Veteran Member
Posts:71


Send Message:

--
05/18/2020 9:30 AM

    I need some advice on the best way to send an individual email to multiple people with different data.

    Info: IPA triggered when receive a file. Comes multiple times a day. Has less then 50 records.
    Each file will contain multiple records for the same SA, however the file is in a random order.  I need to send One email to each SA containing information about each record processed for them.  The email can be sent for each file or once a day.

    I've consided:
     1. creating an array for unique SA's; write the records and results to an external file; Loop through SA array and create email by reading the new file (pulling just the records for the current SA)  -- This would cause the file to be read multiple times.
     2.  Write the records and results to an external file; Create crystal report to read the file and have LBI send emails. --this option has an external (from IPA) process.
     3. creating an external file for EACH SA as the data is read. After all records are read and processed have IPA send an email to each SA with Their Attachment only.  (this idea just came to me so isn't entirely flush out yet).
    What are your suggestion?

    David Williams
    Private
    Private
    Veteran Member
    (3295 points)
    Veteran Member
    Posts:1109


    Send Message:

    --
    05/18/2020 10:08 AM
    Joan,
    You have several options. You can load the file into memory (Assign to a variable) and then sort it (JavaScript) if the SA is the first record. Otherwise, you can still read it with a for loop and create a new array of the SA's from within the file. Use a DataIterator to cycle through the SA array and pull out the records you want (using JavaScript) to build your new individual file. Within the DI loop, you will retrieve the records matching the SA, write out your file and then email that file (no need to name differently) as an attachment.
    David Williams
    Joan Herzfeldt
    Private
    Private
    Veteran Member
    (183 points)
    Veteran Member
    Posts:71


    Send Message:

    --
    05/18/2020 3:25 PM

    Thank you for your response.  That was my first thought, too.   Since the SA field is the Last field I created a SA_Array I assumed I'd have to use a For Loop node, but DI will work too. (assuming, I use a comma for the delimiter).  I just wasn't sure it there was a better way to do it.

    Thanks for taking the time to review my question.

    You are not authorized to post a reply.