Iterate through each row(col) and check if the first row completed


I have a datatable and im checking if each cell contains a value or not to check that am using two for each loops:
for each-> Dt.Rows
for each -> Dt. Columns

if any of the value is null i need to store the column name -> “col.toString”
and mail the missing column to admin. so this is my requirement…
Here the issue is i need to send mail only after the loop completes the first row…fo ex my DT is 4 rows and 10 columns… I have checked each row by using the above condition so how to check if the first row has completed and mail and also to all other 3 rows.
if i put the send mail activity inside the for each it sends mail for each row(col) but i want to send once it completed the first row i need to send mail. and after same for second and third row. Can anyone suggest some ideas please???

Hi @Muthulakshmi_Thangamuthu

Try this workflow

I had added the logic of how to find the columns name for each row whose value is null after that u can add mail message activity to send the mail within the loop itself (1.4 MB)

Hope this helps you

Mark it as solution if you got the answer


Nived N

Happy Automation

Hi @NIVED_NAMBIAR Thanks for the suggestion. If i want to select column not only empty but also a value that contains “item” in it.
i tried ur code like :

(From n In Enumerable.Range(0,row.ItemArray.Count)
Where row.ItemArray(n).Equals("") Or row.ItemArray(n).Contains(“item”)

but its not working

Hi @Muthulakshmi_Thangamuthu

I had made a little changes to the workflow

Check this (1.4 MB)

1 Like

Thank you so much. it really helped

1 Like

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.