## Related terms

- data\-transformation
- synerise\-jinjava
- import
- automation\-module

See the [glossary](/glossary.md) for definitions.

---

# Add Column


This transformation step allows you to supplement the data with the required information which your input data may be missing. It lets you create a new column with the rows that contain the target value.

## Step configuration
---

<figure><img src="/api/docs/image/4376cf0d6777ed14cb3810d274ef0bd1f5e68491/docs/automation/_gfx/dts-add-column.png" class="medium" alt="Configuration of the Add column step with the list of options for initial values"><figcaption>Configuration of the Add column step</figcaption></figure>

1. In the Data Transformation Studio, [add](/docs/automation/data-transformation-and-imports/creating-data-transformation#add-transformation-steps) the **Add column** step.
2. In the **Type column name** field, enter the unique column name.
3. From the **With initial values** dropdown list, select one of the options:  
    - **Static value** - the rows in the new column are filled with the value you enter in the field next to the dropdown list.
    
      <div class="admonition admonition-important"><div class="admonition-icon"><svg xmlns="http://www.w3.org/2000/svg" fill="none" viewBox="0 0 24 24" stroke="currentColor" stroke-width="2.5"><path stroke-linecap="round" stroke-linejoin="round" d="M12 8v4m0 4h.01M21 12a9 9 0 11-18 0 9 9 0 0118 0z" /></svg></div><div class="admonition-body"><div class="admonition-content">

      If you leave the field empty, the values in the column will be empty strings.

      </div></div></div>

    - **Dynamic value** - the rows in the new column are filled with the result of a Jinjava insert. You can only refer to the data in the transformed file, for example, by using `root['columnName']`. Inserts that retrieve data from Synerise, such as profile attributes, aggregates, and expressions, aren't supported.  
    For the list of inserts you can use, see [Data transformation inserts](/developers/inserts/imports).  
    - **No value** - the new column is added with empty rows.  
    The values in the column will be null. It means that if a corresponding attribute exists in the database, it will be deleted.
    - **UUID** - the rows in the new column are filled with a randomly generated UUID v4 (unique for each row).
    - **Current date** - the rows in the new column are filled with the current date (the date and time are generated on an ongoing basis during the transformation). After selecting the **Current date** option, [configure the date format](#current-date-option).
4. To add more columns in the same step, click **Add rule** and repeat steps 2-3.
5. To define what happens if rows contain errors, from the dropdown list next to **Add rule**, select one of the [error handling](#handle-errors) options.
6. Confirm the settings by clicking **Apply**.
7. You can check the result in the **Output** tab.

### Current date option

Using the **Current date** option, you can enrich your data with a dynamically injected date and time which can be used, for example, to build an event salt.
To define a rule with **Current date**:
1. Select a timezone.
2. Select one of the available formats:
    * ISO (for example 2022-10-05T05:55:16.786596Z)
    * Timestamp (for example 1664949342323)
    * MMM d, YYYY (for example Oct 5, 2022)
    * MMM d, YYYY, HH:mm:ss (for example Oct 5, 2022, 05:57:14)
    * YYYY-MM-dd HH:mm (for example 2022-10-05 05:57)
    * Custom - you can create [your own date and time format](#custom-date-format).

#### Custom date format

You can use the following elements to build a custom format. The example values use October 05, 2022 as the date.
* MMM - name of month (Oct)
* MM -  number of month (10)
* DD - day of year (278)
* dd - day of month (05)
* YYYY - year (2022)
* YY - year (22)

### Handle errors

You can define what happens with rows in which the step fails (for example, as a result of Jinja rendering). From the dropdown list next to **Add rule**, select one of the following options:
- **Skip row if error occurred** - It omits the row when an exception occurs.
- **Skip if result is null or empty string** - It omits rows with empty strings and `null` (which may be the result of rendering Jinja).
- **Stop further transformation** - The transformation stops at the row with an error. The data before the line that caused the error is transformed (and imported if the transformation is used in the Data Transformation Studio node).
- **Insert null if error occurred** - Wrong values are replaced with `null`. If you use such a transformation for the import of profiles, the existing value of an attribute is cleared and replaced with the `null` value.
- **Insert empty string if error occurred** - Wrong value is removed and the cell remains empty.

## Example of use
---
You can create a transformation of sample data with customers' data by adding a `marketing_agreement` column with the `true` value. Later, you can use this transformation while importing customers to Synerise.

1. In the Data Transformation Studio, [add sample data](/docs/automation/data-transformation-and-imports/creating-data-transformation#add-sample-data) with customer data.
2. Click **Add step** and select **Add column**.
3. In the configuration of the step:  
    1. In the **Type column name** field, enter `marketing_agreement`
    2. Leave the **With initial values** dropdown list at default (**Static value**).
    3. In the field next to the dropdown list, enter `true`  
4. Confirm by clicking **Apply**.  
    **Result**: In the **Output** tab, the data contains a `marketing_agreement` column with the `true` value in all rows.
