When I entered a variable in the Column* section, the default value didn’t work.
But when I use Column Name* section in Add Data Column Activity my default value worked.
Please tell me, why this happened.

When I entered a variable in the Column* section, the default value didn’t work.
But when I use Column Name* section in Add Data Column Activity my default value worked.
Please tell me, why this happened.
This property is set for column name and not column . So default value works for column name
DefaultValue - Specifies the default value for the new column when creating new rows.
Column is datacolumn datatype but column name is String type so it will consider your default value
If you pass the Variable in the Column filed the option properties under this activity is ignored.
If you give the Column Name in the Column Name field the properties will work.
Find the below image for your reference.
Hope it helps!!
If you have got the answer to your query kindly mark as solution and close the thread
For further information on this topic you can have a look at
[https://docs.uipath.com/activities/other/latest/workflow/add-data-column]
Regards,
The “Column” property expects a variable that specifies the data type and name of the column. However, this property does not have a direct field for setting the default value.
The “Column Name” property expects a string value, which is the name of the column you want to create. When you use this property, UiPath will automatically create a new column with the specified name in the DataTable and infer the data type based on the default value you set.
If you want to create a new column with a default value in the “Add Data Column” activity, you should use the “Column Name” section and set the default value before adding the column to the DataTable. If you use the “Column” section, you can still create a new column, but you’ll need to handle the default value separately, such as setting it later in a loop or using other methods.
Data Type Mismatch: The “defaultValue” property should be set with a value that matches the data type of the DataColumn being created. For example, if you are creating a column of type Integer, the defaultValue should be an Integer value, and similarly for other data types.
It was a good question. @Md_Raiyan_Khan
If you got the solution for your query make mark it as solution which helps others.
Happy Automation!!
@Md_Raiyan_Khan
If You have any further queries then please dont hesitate to ask
If not kindly mark as a solution such that it will help the community
Below link points out the steps to mark a post as a solution
[Forum FAQ - How to mark a post as a solution]