What is the purpose of Column* section in Add Data Column Activities?

I don’t know what purpose of this?

Thanks,
Rugpong

1 Like

Hi,

Please check the follwoing thread:

Has anybody ever used ‘Column’ as input property in the AddDataColumn activity? - Help - UiPath Community Forum

Let me know if that helps.

Thanks.

Do reach out if you need more info on this or any pre-built example for clarity.

Read it already but still confuse with it.

Thank you for your answering i’m waiting someone who sharing an example to make me clear.

@lovepong66

That field is an alternate field you can supply if you decide to use a DataColumn object instead of a column name. In the world of .NET (which is what UiPath uses) everything is some kind of Object and a DataColumn is one, just like a DataRow is and a DataTable is. Putting these Objects together is how things work under the hood.

If you use “Column Name” in the Activity, I’m pretty sure what UiPath does in the background is generate a new DataColumn object with that name before it appends it to the DataTable. Let me know if this helps.

Thanks!

Hi @lovepong66

This Column section would take a Variable of type DataColumn.
Alternate way of creating a column inside a datatable.

See this example, initially I had 3 columns in my dataTable.

I have used DataColumn type variable ColumnName, assigned a value to it new DataColumn(“Column4”)

And then used Add Data Column activity and passed that ColumnData Variable in here.

The outputs are as follows:
image
e

1 Like

@lovepong66

Basically say you have a datatable with four columns and you want to create a new one with same strucutre as one of the columns from initial datatable…

Then you can give that datacolumn as reference and can create it…it is used for that

If you use that then type name etc are not needed it will take fromat from the datacolumn provided

Hope this is clear

Cheers

Thank you very much for the answers so… i used way like this it works!.

but, imagine if i need to create more than one columns in one execute is it possible to do it?
because after i tried to write something like this it unacceptable.

Thank you

@lovepong66

You can create only one column at one time…multiple is not possible…for that you can use build datatable activity instead

Cheers

1 Like

Oh!!! Thank you very much i got it.

1 Like

That’ll Create only one column, you can only give one column name.
You can write an array of string and
then loop through the array and add datacolumns one by one.

Thanks :slight_smile:

Glad that I could be of your help!

1 Like

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