Multiple recipient in CC based on conditions uipath

Guys, I have a very strange question which I have not found any solution yet.

My bot will send some emails to several person. There will be more than one person in the CC, but not alwasy the same person. To make it clear, let’s say, there are 5 email IDs for 5 person. We can number them like this-

  1. A
  2. B
  3. C
  4. D
  5. E

(A,B; C; D and E are the email IDs for person 1, 2, 3, 4 and 5)

Based on various conditions, my bot will receive some numbers, e.g. 1,3,4. It means bot now has to add A, C and D in the cc field in the properties. It might be any number from the list I mentioned. It means, the email ID in cc is not fixed.

I can use condition like if bot gets 1, then A, if 1 and 2 then A and B. But how can I put these email in the cc field. Those email address A, B, C are in variables as string.

I really doubt that email in CC can come dynamically. But if someone has any solution, I would really appreciate.

Thanks and Regards,

Hi @jahidKM

just pass all email addresses with ; in between them and that’s it. (emailsCC= A+";"+B+";"+C)

Hope this helps! :smiley:

2 Likes

Hi @jahidKM
This thread could help you resolve your issue

Cheers

1 Like

Thanks for the reply. May be I was not clear enough in asking my question. The problem is Bot will send email based on the number, each number belongs to each email ID. Meaning that, if bot recieves 2 and 5, then only B and E will be added to CC. If bot receives 1 and 4, then A and D will be in CC. It means, the receivers in CC will always be changed everytime I run the bot.

So only adding all the emails in CC, like you suggested, won’t work in my case.

Sorry, maybe my first answer wasn’t clear enough.

No, no I didn’t wrote that you add all of them, I just wrote how you can pass emails to cc field based on your “But how can I put these email in the cc field.”

If you need suggestion how you can solve this logic, I would create function where I can pass array of ID’s and Dictionary<int,string> and later I would use some switch based on your key inside loop. If I have hit based on key I would concatenate string from Dictionary like: emailsCC= A+";"+B+";"+C and pass that emailCC to “Send Outlook Email” activity.

Cheers!

1 Like