During the first steps of my bot, I created a folder with a dynamic amount of Excel Files. These Excel files all have the same structure. The Excel files are also named after the persons who will receive the files.
Example: folder with 3 Exel-Files
Each Excel-File contains the Name (for instance Hoffmann John) at the field position I2 and the Email-Adress at the field J2 (for instance: email@example.com).
The goal now is to send an email to each person when there is a Excel-File with the same name in the folder. The Email always has the same text, but should only contain the respective Excel-file in the attachment So I need to somehow find a logic which checks the dynamic created files in the folder, then sends an Email to each person with the respective Excel-File.
My solution approach:
- Get all the file names as String variables: I looped through all files in the folder, which always contains the before-created Excel-Files. I created a name and extension variable. It shows me the name and the .xlsx in a message box. I could not manage to get each file name into a seperate variable with string assign within the loop (it only shows all file names and to filter for each name in the loop is not possible. At least I don’t get it).
- Transform all String variables with the Excel Sheet names to file variables (Email: Send action attachment only works with file variables)
- Find logic to map the Excel-Sheets to the Email-Addresses. Something like: if the name of the Excel-File == Excelfile[I2] then send an Email to Excelfile[J2] -» if the name of the Exce-File is the Same as the Person’s Name then send an Email to the respective Email-Address.
I’m happy about any hints!