How to create many data tables from one data table

Hello everyone,

i have a datatable. And it has a column named “Contacts”.

i want to create many datatables for each contact.

Should i use Filter Datatable Activity or another one? Is there anyone know that?

@mazlumkacar

You can use Filter DataTable activity or select query to filter data from Excel file.

@mazlumkacar
Have a Look on the Last solution i Provided to you. In one of for each blocks you find a Line in the foreach config with a distinct Statement. There you can See an Implementation doing this.

Otherwise Same Procedure provide us sampledata and WE can Work Out a suggestion

At your last solution the workflow group by data.

But this time i need to a workflow create many data tables or excel files for each contact from one data table.

And also this time it can be better -for ease of maintenance- build a workflow that has activities, not .net codes :sweat_smile:

@ppr

But there are many contacts. So i cannot write query at Filter Data Table Activity for each contact. Is there any extra solution?

@lakshman

@mazlumkacar
just to bring on the definitions. Most parts you had seen is LINQ already integreated in .Net and even valid to use in UiPath.

Many contacts is relative. What is many 100,1000, 100k, 100 Mio?
But when its many you are defintively interested on performant solutions

the base pattern schould be alwas the same, the detail imp may differs and is similar to @lakshman feddback. All similar parts can be found in the other xaml as mentioned above.

iterate with a for each / for each row over the datatable for each contact

  • maybe you have to create a list of dictinct contacts before and use this for iteration

inside the loop filter for each iteration for the particular contact the datatable
copy the filter result with copytodatatable to a new/temp/seperate datatable

Still same request. If you need more help, just provide some sample data to us. With this we are saving time and can work out faster a suggestion

is each contact unique in the data?

@ppr

yes it is unique but each contact in the data table goes through many times

@mazlumkacar
sorry I didn’t get you:

  • If each contact is unique in the datatable then only 1 row per contact is in the data

but each contact in the data table goes through many times

what does it mean? per each contact one or more rows can occur in the data?