Add Data Column Error like in the following

I just build a data table like in the following

And in the -For Each Activity- after the condition i want to add the column into my data table

but error occurs

Hello @170290064 ,

looks like you already have the column in datatable and trying to add the same column name again

As per your logic, the data in Model Column should be Unique.

But whats wrong adding the same column in the excel sheet

UiPath Data table will not allow you to add columns with the same Name.

can you explain more about your requirement

image

Date can be the same but other columns are changing.

Idk whats wrong with that :robot:

the excel which you showed is good. Do you want to add a new column or a row.

Let us know what is the output you are expecting.

the output that Iā€™m expecting exactly the same that I showed you in the Excel Sheet so after the condition in the For Each activity if the date greater than the indicated date then Iā€™m going to add new columns modem date and price. Thatā€™s it

que-5.xlsx (25.2 KB)

This is the excel file. I ll get data from Otomobil-Modified Sheet. Then write it into the ā€œModelFiyatlatıā€ Sheet.

Maybe i should add them in only one ā€œAdd Data Column Activityā€ or ā€œAdd Data Row Activityā€

:thinking: :thinking: :thinking: :thinking: :thinking: :thinking: :thinking: :thinking:

yes, use add data row

How to write these 3 columns with 1 row with Add Data Row Activity ???

Hi @170290064

{CurrentRow(ā€œColun1ā€).ToString,CurrentRow(ā€œColun2ā€).ToString}

image

1 Like

Use assign activity to filter by date

dtModified.Select(ā€œ[Ä°lan Tarihi] > ā€˜16.07.2023ā€™ā€).CopyToDataTable

and use filter datatable to fetch the only columns you need

image

In this way you can achieve your solution without using foreach loop

attaching xaml file for your reference.
excel1.xaml (10.9 KB)

1 Like

@170290064

If you got the solution for your issue. Please mark it as solution to close the thread and others also helped.

Regards,

Thanks for all

@Sreelatha278
@lrtetala

1 Like

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