How to filter column A about null and extract values which are relevant from column B

I’d like to copy the value, which is from the excel file, into the system.

However, I’ve tried many times, but it still extracts the wrong one.
Hope anyone can help me !

Here’s the table looks like :

And the steps are as follow :
Every time RPA opens the file
(1). it would find the first null in the column “Person in charge”
(2). find the value in the column “Event Number” based on (1)
(3). copy the value and paste into the system

Does anyone have any idea ?
please help me to solve it
many thanks~

Workbook Read Range into a datatable. For Each Row loop to do what you need to do with the values and update the Person in charge value for the row, then Workbook Write Range back to the spreadsheet.


Hope the below steps would help you resolve this

  1. Use a excel application scope and pass the filepath as input and use read range activity and get the output with a variable of type datatable
    Named dt

  2. Then use a FOR EACH ROW activity and pass the above dt variable as input

  3. Inside the loop use a IF condition and mention like this

String.IsNullOrEmpty(row(“Person in charge”).ToString.Trim)

If true it goes to THEN part where use a assign activity like this

str_output = row(“Event Number”).ToString

Cheers @Chen_Hobbit

Hi @Palaniyappan ,
Thanks for your help !!
It finally works


1 Like

Hi @Palaniyappan ,

I’d like to ask another question
After I get the “Event Number” in the step(2), I want to type “RPA” back in null cell in the “Person in charge” before I copy to the system.

I’ve already used Write Cell to fill “RPA” in the cell and the Range mentioned as “row(“Person in charge”).ToString”.
But it turned out nothing, the null cell is written in nothing, then.
It just goes to the step(3) to copy Event Number to the system.

How should I fill in Range in the Write Cell Activity in this situation ?
Thanks for your help !!

1 Like

Here in the same THEN part use a another ASSIGN activity and mention like this

row(“Person in charge”) = “RPA”

This will write the text RPA in that null cell of column “Person in charge”

Cheers @Chen_Hobbit

Hi @Palaniyappan ,

it still shows nothing in that null cell of column “Person in charge”
and there’s no error message popping up.

No worries

Can I see the screenshot of the activity been used

Here’s the screenshot in UiPath :


and here’s the screenshot of Excel file


and it just shows nothing in the row(“Person in charge”) under the condition.
Appriciate for your help~

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