Excel automation using for eachcolumn and check if row number 148 has value less than 5

Hello all
In UiPath in a datatable i have a requirement to check for rowno 148 has value greater than 5 or not in each column .
Thanks in advance

Read the excel sheet using read range
then use for each row In data table
take if activity
You can use the DataTable.Rows collection to access rows and columns using indexes. For example: yourDataTable.Rows(147)(columnIndex). The index is 147 because indexes are zero-based.
If the condition is met, you can perform the desired actions.

Hope this helps,
let me know if it works or send me input file so that i give a try

@kambhampati_manisridhar

To find row contains the required value

dt.Row(147).ItemArray.Any(function(x)
cint(x)>5)

Gives you boolean output

To check in any column

To check only one specific column use below syntax

Booloutput=cint(Datatablevar.rows(147).item(“columnname”).ToString)>5

Cheers

If (dt_Table.Rows(147)(column) > 5)

Regards,

Hi @kambhampati_manisridhar

For Each column in DataTable.Columns
If DataTable.Rows(147)(column) > 5
// Perform actions (e.g., log the column name)
End If
End For Each

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