Looking up a value from column to column in an excel

Hi There,

I have a table with 4 columns

CL1 CL2 CL3 CL4
A 1 June App
B 2 July API
C 3 Feb REST
D 4 Mar UI
E 5 Apr UX
F 6 Jan Flow

Using lookup table, I have been able to lookup values (eg: “A”, “F”) in CL1 and pickup results from CL2 (target column) into a form.
Once the form is submitted
The bot needs to lookup values from C1 and pickup results from CL3 (target column) into the same form.
And this loop needs to continue until CL4.
And then End.

Any help is really appreciated, I am newbie to UIpath and even newer to coding :-).

are you already using the Read Range?
You can use Filter Data Table or code
I don’t know if you can explain the need a little better

Hi Beatriz,

Thank you for your reply, I will rephrase the problem, my current solution is cumbersome and I am sure there could be a better (cleaner) alternative…

CL1 CL2 CL3 CL4
A 1 June App
B 2 July API
C 3 Feb REST
D 4 Mar UI
E 5 Apr UX
F 6 Jan Flow

For the above table, how should I go about looking up some values (“A”, “C” & “F”) from Column CL1 to get values from Target column CL2
Then enter it on a webform
Then start over again for the same values (“A”,“C” & “F”) from CL1 and this time get values from TargetColumn CL3.
Then enter it on a webform
And then repeat the same for the next column - Values from CL1 and then pick values from CL4.

I hope this detail helps…
Again thank you so much for your reply and wishing you a fantastic 2021.

Hi @prashanth.naikar

Welcome to forum

U can try the way as suggested by @Beatriz_Eugenia_Duqu

  1. Filter the datatable based on column CL1 using filter datatable activity and store in output datatable dt1

  2. assign a integer varible index and intialise with value one

index = 1

  1. Use a while loop with condition index<dt1.Columns.Count

inside the while loop use for each row to loop through each row of dt1

Inside the for each row to input the values use the following type into activitiy to input the value row(index).ToString

outside the for each row use the assign activity

index = index+1

Hope it helps you

Regards

Nived N :robot::robot:

Happy Automation :relaxed::relaxed::relaxed::relaxed::relaxed:

1 Like

You the magician, thanks a ton Nived, this worked like a charm…

How to put an end to the bot seems like the continued to run…

Hi @pac1

Did u put condition inside the while loop ?

Hi Nived,
Thanks again for the support, I am running into another problem.
The loop runs…however
In the first run, for the four different “Type into field” - It keys in the first row value only
In the second run, for the four different “type into field” - It keys in the second row value only
and likewise

Ideally if the dt1 sheet is…

CL1 CL2 CL3 CL4
A 1 5 9
B 2 6 10
C 3 7 11
D 4 8 12

And if in the first loop I want to get an output say for target column “CL2” as

CL1 CL2
A 1
B 2
C 3
D 4

Instead, I am getting the output as the following…
In the first iteration

CL1 CL2
A 1
B 1
C 1
D 1

In the second iteration I get the following result

CL1 CL3
A 6
B 6
C 6
D 6

and likewise,

Many thanks again for your guidance

Hi @prashanth.naikar

Did u tried in same as I told

Also can u share the screenshot of Workflow

Hi Nived,

Thanks for the support mate,

image

image

Hi Nived,

Do you think I should be using “For Each” activity or “For Each Row” activity?