Assign date

The Assign date masking activity allows you to assign a date value to a specified column of all table records.

Table of contents


To use the Assign date masking activity, it must be placed inside a table masking activity or a similar activity that iterates over data. Once placed, select the property you want to mask and enter the date you want to assign to that property. Date values must be DateTime instances.

While you can directly set a desired value, you can also use custom code to generate a value with a custom algorithm and data. Note that the Assign date masking activity remembers the first value it assigns to a record and assigns the same values to others, i.e. the value (or the custom code that determines the value) is evaluated only once. If you want to dynamically change the assigned value based on available data during package execution, use the Evaluate date function masking activity instead.


In this example we want to mask the BirthDate column in the Customer table. We don't need realistic values from this column during testing, but we still need to mask sensitive data and want to use a valid value. The best way to do this is by assigning an arbitrary date (e.g. 1.1.2000.) to every record in this table. First we place the Customer masking activity and put the Assign date masking activity within it. Once placed, we select the BirthDate property that we want to mask with our chosen date. Here, we will put a new DateTime instance that represents the date of 01/01/2000 as the value we want to assign. We leave other properties as they are.

Assign date example Figure 1: Assigning dates


Property group Property name Description Example
Input properties DataItemProperty The property to mask. Write x => x.BirthDate or choose property from the dropdown list
Value The value to use as a replacement value. new DateTime(2000, 1, 1)
Input: Filter Filter Expression used for filtering records - only filtered items will be masked. x => x.BirthDate != null
SkipDefaultValues If true, default values will be omitted in masking (i.e. null values are not masked). true or false
Input: Repeating RepeaterId The ID of the repeater that will be used to detect repeating and save results when masking item key repeats. DateRepeater
RepeatingKey Key to use for repeating detection. Write x => CompositeKey.Create(x.BirthDate) or choose properties from the pop-up window
Misc DisplayName Display name of the activity in the workflow. Assign date
Result Contains the masking definition object. It's a part of the masking infrastructure and should be ignored. -