Count datatable rows and paste in email body

Hi, is there any way and suggestion to count number of rows in specific column that have same value and passed to email body?

For an example,

Referring to below screenshot:

I want to check how many matched under status column in each of uniques bank accounts(Bank Account Column) and paste the count in email body.

The output can be like this:

Bank Account xx- 43 Matched.


Your suggestion is much appreciated

hi @mashy2

First you can read range and add header to get the column names, and then use for each row and set a counting variable lets say i. then use if condition, if row.item(“Status”).tostring = “Matached”, i + 1. Finally write i.tostring to an email and that’s it.

As @raymondhui said, use read range to get the spreadsheet data into a datatable.

I would then use a filter datatable activity to filter on the “Status” column for “Matched” and use dt.rows.count to give the number of items which matched