Table to table augmentation

I have one table with many rows and columns. One of those columns is username. It is not unique. I have a second table of user details where the username is unique. I would like to add user details from the second table to first table. I can’t identify the correct way to do that. 'join’ing tables does not work.

Suggestions ?

1 Like

Hi, welcome to the Datagrok Community!

Is this something you are wanting to achieve?

//name: augmentTable
//language: JavaScript

let T1 = DG.DataFrame.fromCsv(

let T2 = DG.DataFrame.fromCsv(
Ann,New York
John,San Francisco

let T =
  T1, T2, ['username'], ['username'], ['stars'], ['city'],
  DG.JOIN_TYPE.LEFT, false);;

You can run this code in

It is also possible to achieve the desired result in the Datagrok UI (select “Join type: left” in the dialog):


@dskatov , thanks for answering! I did record a video, but the screenshot you provided explained it perfectly. Let me still add a video though :slight_smile:


I tried the UI but I get the error message that my username in table1 is not unique and so I can not proceed.

Most likely, this warning concerns the “All Janssen People (2)” table. Since the uniqueness of the column values in first table is not important for the left join type.

It may be enough for you to swap tables in Tables field selectors.

You are correct. I had duplicates in the second table that I had to fix. A possible UI improvement would be to move the warning for the 2nd table to be aligned with the second column in the dialog.

1 Like

this is a good point, thanks!

Good catch, we’ll definitely make it more intuitive. Also, we’ll add an option to introduce case-insensitive matching for string columns, as this appears to be a common source of confusion.

1 Like

Just in case, here’s how to convert the column to upper case: