Write excel column if it is the same

I have a variable type data table that I get from an excel

number name
1 angel
2 ruben

what I have to do is write that data table in another excel that already brings the number column so I must write the name column according to the number it has in the number column

image

how can I do that I already know how to write but I don’t know how to see if they are the same and write in the right column

1 Like

hi @Ivan_torres_oliva

Please correct me if wrong…

You have a excel with numbers and name…

In the new sheet you just have the numbers, you want to populate the name in front of it ?

If I mis-understood it, please clarify :slight_smile:

I dont get much the queries but can you give input excel and the output desire excel to easily address the issue. Thanks @Ivan_torres_oliva

cheers :smiley:

Happy learning :smiley:

1 Like

So it is in the excel I only have numbers and I want to put the name but according to the number that already has in my variable data table

Hi @Ivan_torres_oliva

Use build datatable activity
And data row activity

Thanks
Ashwin.S

Hi @Ivan_torres_oliva

You mean join the two excel’s table?
If yes,

  1. Read both excels.
    dt_NumberName
    dt_Number

  2. Join Data Tables with the Column Number as their equal column and assign to dt_Out.
    (Assumption: Column Number has unique values)
    Depends on your needs, decide what Join Type.

  3. Write the dt_Out to your second excel.

1 Like


I already read the two excel and joined them by column number but I don’t know how to paste them in the second excel according to the number they have

excel1
image

and this is the excel where I must paste the data excel2

image

EXCEL1.xlsx (8.6 KB) EXCEL2.xlsx (8.6 KB)

I attach my two files in case you need more references and can you help me

the numbers vary in quantity so I can’t just specify the range “B4: C7”

could you also provide a screen shot of your Join Data table Wizard?
and how do you write them to the second excel?

from what i see,
Input Dt 1 should be the excel 2 dt
Input Dt2 should be the excel 1 dt
Join Type is Full or Left ( definitely not Inner if you want to retain the previous data of excel 2)

1 Like

looking at it in another way you will have to write the name column of Excel 1 in the name column of Excel 2 after the last cell with data from the same column name of Excel 2

image

Ahhhh now that you mentioned it! Hahaha
We should separate the EXCEL2 NUMBER with data and without data before we play around with it. I think we need use Filter Data Table and Append Range.
I’ll get back to you with a sample xaml if you or someone don’t beat me to it.

Like this perhaps, if implementing it purely with UiPath activities?
Instead of Append Range, I used Merge Data Table, btw.
(I bet Data LINQ skilled people will suggest other ways, though)
Hope it helps!

DatabaseJoinForum178706.xaml (9.5 KB)

1 Like