Sending multiple emails

Author
Messages
Lyle Zaehringer
Basic Member
Posts: 8
Basic Member

    I'm building my first IPA process and would greatly appreciate some help with one of my last hurdles. I'm reading in a file of records and iterating through those records. The records could be of type A, B, or C. At the end I want to send 1, 2, or 3 emails, depending on whether the number of records of each type (A, B, C) is greater than zero. For example, if all the records are of type A, only send email from node A. However if records of all types exist then send an email from all three email nodes.

    I've already got a variable successfully tracking the count of each type of record in the file.

    For my first attempt, after leaving the data iterator, I go to a branch node that has 3 branches. One branch's criteria looks for count of type A > 0. One branch's criteria looks for count of type B > 0, etc.  When I pass a file with all three record types, only the first branch is followed. I would have thought that any branch whose criteria was true would be traversed. At least one of the branches will always be true, and when only one is true my criteria works. When more than one is true, only one is traversed. Any ideas?

     

    Terry P
    Veteran Member
    Posts: 234
    Veteran Member
      How about changing the logic to be something like this:

      If Type A > 0 go to email type A. Then exit after email type A to another Branch: if Type B > 0, etc. The other branch would be if Type A = 0, go to the second branch for Type B. Repeat for C, etc.
      Woozy
      Veteran Member
      Posts: 709
      Veteran Member

        Hi Lyle,

        Flows only allow one task at a time, and a branch node just looks at each branch in order until it finds one with a value of "true".  Only one branch will be followed. 

        In order to do what you want to do, you need to put the nodes in series rather than parallel:

        By doing this, the first value is evaluated.  If it is true, then the first email is sent.  It then checks the second value and the third value in turn. 

         

        I hope this helps!

        Kelly

        Kelly Meade
        J. R. Simplot Company
        Boise, ID
        Terry P
        Veteran Member
        Posts: 234
        Veteran Member

          Something like this:

           

          Lyle Zaehringer
          Basic Member
          Posts: 8
          Basic Member
            This program is a complete paradigm shift for me. I like this solution, and it indeed worked. Thanks, Terry! And thanks Woozy for describing IPA in terms of series/parallel. That definitely helps as well.
            ---