Hello,
I have a folder with excel files with name Hyderabad, Bangalore, Delhi etc and I have another excel file which has data with column Hyderabad, Bangalore, Delhi. If excel file in the folder matches with same in column data then I need to send that excel file to mail. How to do this? Please help me with this
Hi @ISBS_ROBOT
Read the Main Excel File using read range & store the output in datatable
- Read data in Excel using read range & store output into DataTable (MainDataTable)
Get the list of Excel files from for each file in a folder activity
- Get list of Excel files
- Extract file name without extension (FileName)
- Compare FileName with values in MainDataTable
- If match found
- Send email indicating the match
Hope this helps
- Read Range (Read Excel file with column data into a DataTable)
- Assign (Create a list of Excel files in a folder using Directory.GetFiles)
excelFiles = Directory.GetFiles("YourFolderPath", "*.xlsx")
- For Each (item in excelFiles)
a. Excel Application Scope (Use this to read each Excel file)- Read Range (Read the current Excel file into a DataTable)
b. For Each Row (row in DataTable from step 3a) - If (Condition: row(“ColumnName”).ToString = “Hyderabad” or any other matching condition)
- Send Outlook Mail Message (or any send smtp mail activity)
- Attach File (Attach the current Excel file)
- Send Outlook Mail Message (or any send smtp mail activity)
- Read Range (Read the current Excel file into a DataTable)
Unable to send the mail.
Hi What is the error you are getting while sending email?
Are the names column names or data?
if column names then loop on columns dt.columns and then send email based on it currentitem.columnname will give the name
cheers
Here file names in folder matches with the excel column
New folder.zip (106.5 KB)
UIIC MAIL IDS.xlsx (27.7 KB)
Excel file in the folder should match with the same mentioned in the another excel file and then send the file through mail. Please share the sample workflow.
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.