Hi, the workflow is currently reading an Excel file as below.
I would like to know, what are the ways to send out an email only once to Ben when there are more than one row for Ben.
Currently, I am using an approach suggested, which is :
However, I am not sure how to select the right “CC”.
Try below steps
Read Range (Excel File)- output - dtSheet1
Assign Activity → dtNew(DataTable) = dtSheet1.AsEnumerable().GroupBy(Function(a) a.Field(Of String)(“Name”)).Select(Function(b) b.First).CopyToDataTable()
Write range → Wirte dtNew to “Sheet2” → You will get new datatable(dtNew) with Unique rows.
Again Read Range → Sheet2
Use for each row to iterare on dtNew-> Send mail to each person once.
you can skip steps 3 and 4 and directly iterate over dtNew to send mail.
Try below expression.
( From row in dtInput Group row by a = row("Name").ToString.Trim into grp = Group Where grp.Count > 1 Select grp.First ).CopyToDataTable
Note: Here, dtInput holds your input data and it is of type DataTable.
Try this below expression
(From p in DT.Select() where( From q in DT.Select() where q("Column Name").Equals(p("Column Name)) Select q).ToArray.Count>1 Select p).ToArray.CopyToDataTable()
DT is an Input Data Table
Please mark as solution if its resolved your problem.
The approach you are using will provide you the unique values only from the column HOD and not others, To get the email you can follow the approaches provided by my fellow mates over.
to take multiple columns you can separate them by , values like “HOD”,“Email”
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.