Help for E-Mail Automation

I have multiple excel files, each having data for individual location in a folder(about 15 files), and I am trying to e-mail these files only to their specific location manager. I have another excel file(reference), which has the details of e-mails by location to be sent. Can any of you guide me on how can I achieve this task or what activities should I use for this purpose?

Thanks in Advance !
Shay

  1. use Read range to get the reference.
  2. Get email activity and save them to a specific folder
  3. Assign an array and use directory.get to store the name of these files
  4. Use For each item to loop the array
  5. Use switch and set condition for different email contains specific name
  6. sent email after each switch case

Hi @shay

You should first get all your files to an array.
Dictionary. GetFiles(path) will give all the files in the location to an array. Then use a for each loop to loop through your files
You can access the content of the excel using excel related activities. If the location is mentioned in a specific cell all the time in all your files you can use the read cell activity. If its stored as rows use a read range and access the data

Next loop through your location data and use a switch activity to have the location conditions. Within each have your email send defined. I suggest to use a new workflow for the email sending and invoking it in each switch condition with the required parameters. This will reduce the code repetition as well

1 Like

Thanks for your response !

Just one more thing, will I need to use something like v-lookup to match the file name, with the name in reference file in order to get the email information ?

If you wish to use it, you can… or else you can simply use a IF activity within a for each row loop that loops through your location data file data.

I will try that thanks !