Hello.
I have data as below.
I want to read data column B , C in row that first row that column A and D not blank .
Please guide me about it.
Hello.
I have data as below.
I want to read data column B , C in row that first row that column A and D not blank .
Please guide me about it.
Just read whole data into datatable using read range
Then use a filter datatable and add filter on column A and column D to be not empty…the rows remaining are the non empty rows
Cheers
Hii @Stef_99 follow these steps
dtData.Not String.IsNullOrEmpty(CurrentRow(“No”).ToString.Trim) AndAlso Not String.IsNullOrEmpty(CurrentRow(“Status”).ToString.Trim)
if the condition is true
nameValue = CurrentRow(“Name”).ToString
idValue = CurrentRow(“ID”).ToString
later on Use “Break” activity to exit the loop after finding the first matching row.
cheers!!
Hi @Stef_99
You can also try the LinQ
dt_input = dt_input.AsEnumerable().Where(Function(row) String.IsNullOrWhiteSpace(row("Staus").ToString()) AndAlso String.IsNullOrWhiteSpace(row("No").ToString())).CopyToDataTable()
And if just want the columns Name and Id then use
dt_input = dt_input.AsEnumerable().Where(Function(row) String.IsNullOrWhiteSpace(row("Staus").ToString()) AndAlso String.IsNullOrWhiteSpace(row("No").ToString())).CopyToDataTable().AsDataView.ToTable(False, "Name", "ID")
Hope this helps
@Somanath1
How to get number row that found first tow?
Hi @Stef_99
Use the below LINQ expression to get the rows which are Column A and B are not empty,
dt_Output = dt_Input.AsEnumerable().Where(Function(row) Not( String.IsNullOrWhiteSpace(row("No").ToString) AndAlso String.IsNullOrWhiteSpace(row("Status").ToString))).CopyToDataTable
The above expression will filter the rows and keep first row in dt_Output as per your Input data.
Hope it helps!!
If I want to read data in row and stamp result in each row.
How to guide me about it
.
Can you share your expected output data, then we are able to understand your query clearly… @Stef_99
@mkankatala I have data input1 as below.
row No1 column Status have data go to next row that status = blank
found row2 status = blank → read data in row for checking in web —> stamp result in column Status
Try this workflow
Read the input excel to the datatable dt_input
Difine the condition for the while according to your use case
emptyIndex = dt_input.AsEnumerable().ToList().FindIndex(Function(row) String.IsNullOrWhiteSpace(row("Status").ToString()))
dt_input.Rows(emptyIndex)("Status") = webOperationResult
I tried with a sample input and it works
Hope this helps!
This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.