How to refer to a specific Data Table Cell in an if statement


I have a flow where an excel file is read, the last row with content is found and stored in a variable, then the variable is converted to string and stored as the variable ‘string row’. The goal is to see if the specified cell, indicated with the Column Name and row number contain a specific string then another value is captured. Below is what I’ve gathered from previous forum posts however it provides an error about string to integer issues.

stringRow is a variable and Issue Types is the name of the column header

datatable.rows(“stringRow”).item("[Issue Types]" = “Contacts”

Any help would be great!


Hi there @terber,
While I am not 100% certain on your requirements, the below statement is slightly off.

datatable.rows(“stringRow”).item("[Issue Types]" = “Contacts”

The majority is perfectly fine, however, your RowIndex should be an Integer value, as shown below:

YourDataTable.Rows(RowIndex).Item("ColumnName").ToString = "Contacts"

To use your example, it would look like:

YourDataTable.Rows(YourDataTable.Rows.Count - 1).Item("Issue Types").ToString = "Contacts"

The above will check whether the value in the “Issue Types” column of the last row equals “Contacts”.

Thanks in advance,

Thank you so much!! I was researching for a few too many hours considering the issue.

1 Like