How to select a particular row and get the value of the row in a particular column

I have this excel file that looks like below. I would like to filter and get this particular row which contains (Weekly/MonthlyFile) and the value in the row of the 3rd column (It has a header not shown below but named ‘amount’). In the end i shud get the value ‘111’. How can i go about doing this? Without hardcoding like the row number as the row isnt constant

Book1.xlsx (10.9 KB)

Thank you xoxo

step 1. Read the excel file and put output in a DataTable type variable dt.
step 2. read “dt.Rows(8)(2).ToString

4 Likes

@reyaz Yes yours work but its too hardcoded. The row isn’t constant. It will change…

You can use For Each Row Activity to iterate through all rows

Use This WoflowMain (7).xaml (8.9 KB)

Regards

ye, but how to specify the row and the column name

Hi @sangasangasanga,

dt.Rows(RowNumber)("ColumnName").ToString

Else Use For each row activity inside you can use
row("ColumnName").ToString()

Regards,
Arivu

2 Likes

you can use column index instead of Column Name

@arivu96 Yes but the rownumber isn’t constant thus i cannot use that way. For for each activity, It will get all the rows. I only want that one particular row

@sangasangasanga, Yes, but you can access that value.

So how you want the output?
Expected Output?

Use Filter Data Table Activity to get one or specific rows

@reyaz @arivu96 @Himanshu.joshi Hi I have edited my question. I changed the format abit. I have to search in the second column for the string that contains ‘(Weekly/MonthlyFile)’ as a substring
Main (7).xaml (9.9 KB)

However, this line does not do that.
row(1).ToString.Select("Date LIKE %(Weekly/MonthlyFile)% “)
nor
Dt.Select(” Date = * (Weekly/MonthlyFile) * " )

Hi @sangasangasanga,

use the below code to get only Weekly/MonthlyFile string contains the value alone.
Dt=Dt.Select("Column1 like '%(Weekly/MonthlyFile)%'").CopyToDataTable()

else

Use For Each Row
Input Dt

use if condition

row(1).ToString().Contains("(Weekly/MonthlyFile)")
If True-> value available in the row
Else → value not available.

Regards,
Arivu

@arivu96 Your solution works. But it is not ‘Weekly/MonthlyFile’ is not the only value. It has some value after it. Because the code looks for the exact value of ‘Weekly/MonthlyFile’ which is not found in the rows

it will work bro i have used % after that string also so it will return the value.

Regards,
Arivu

Main (7).xaml (12.6 KB)

But it doesn’t bro. Idk why…

is it because using read csv differs from reading excel

HI @sangasangasanga,
Main (7) (1).xaml (12.9 KB)

i have updated the xaml file please check it

Regards,
Arivu

1 Like

The output is all ‘no’ even tho the string exists

image

Hi @sangasangasanga,

In Read CSV activity read only the first sheet alone.

use excel application scope, please find the xaml file
Main (7) (1).xaml (15.5 KB)

Regards,
Arivu

1 Like

Hi, i couldn’t upload my csv.file It says ‘Sorry, the file you are trying to upload is not authorized (authorized extensions: jpg, jpeg, png, gif, xaml, nupkg, cs, zip, json, pdf, html, xls, xlsx, xml, vb).’
It looks like this

Downloads.zip (2.8 KB)