Whenever you work on Datatables, you have to use “FOR EACH ROW”
To extract Column names you use Assign Activity and assign the column to variable
“DatatableName.Columns(0).toString()”
Column starts from 0
You can have logic to read columns dynamically say for example last row of excel
then you can use count of the columns and subtract it by 1, it will fetch you last column
Yes, it is possible @Mahesh_Gunda
Use If activity to check for blank cell and then use “Throw” activity if condition is satisfied
e.g :-
if (row.Item(“ColumnName”).ToString) = “”
then
Throw
else
do all your processing
@Mahesh_Gunda
Not knowing all your requirements by taking the trigger:
I want the bot to capture to column name when a blank cell is encountered as an exception in catch block.
we can map to the interrest of getting all column names of blanks within a row
With an IndexOf Approach the first occurence will be returned, other blanks are not transported. A LINQ help us to get all information:
checking if there a blanks in the row:
row.ItemArray.Any(Function (x) String.IsNullOrWhiteSpace(x.toString))
Getting a string array with the column names:
row.ItemArray.ToList.Select(Function (x, index) New Tuple(Of Int32, String)(index,x.toString)).Where(Function (t) String.IsNullOrWhiteSpace(t.Item2)).Select(Function (t) row.Table.Columns(t.Item1).ColumnName).ToArray
so a table with:
can be analyzed with code from above and a result could be: