Generate date in range

The Generate date in range masking activity allows you to generate a random date in the selected range.

Table of contents
Usage
Example
Properties

Usage

To use the Generate date in range 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. Generating a date in a specific range requires two dates that define the range. Both the From date and To date dates can be manually entered, in which case they must be in a valid DateTime format or you can use the date selection dialog by clicking on the calendar button next to the input field

Date selection dialog Figure 1: Date selection dialog

Additionally, you can set the DateOnly property to control whether only the date part of the base date should be changed, or if other properties (e.g. time values) should be changed as well.

Example

In this example we want to generate dates for the expiration date column in the CreditCard table so that every generated value is in the year 2020. First we place the CreditCard masking activity into opened Package.xaml and put the Generate date in range masking activity within it. Once placed, we select the ExpirationDate property that we want to mask with generated dates. Here, we will select 1.1.2020. as the From date, and 31.12.2020. as the To date. This will ensure that every generated date will be in the year 2020. We leave other properties as they are.

Generating dates in range Figure 2: Generating dates in range

Properties

Property group Property name Description Example
Input properties DataItemProperty The property to mask. Write x => x.ExpirationDate or choose property from the dropdown list
DateOnly Whether the generator should produce only dates, without time. true or false
FromDate First part of date range used in data generation. 1.1.2020.
ToDate Second part of date range used in data generation. 2.2.2020.
Input: Filter Filter Expression used for filtering records - only filtered items will be masked. x => x.ExpirationDate.DayOfWeek == DayOfWeek.Monday
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. GenerateDateInRangeRepeater
RepeatingKey Key to use for repeating detection. Write x => CompositeKey.Create(x.ExpirationDate) or choose properties from the pop-up window
Misc DisplayName Display name of the activity in the workflow. Generate date in range
Result Contains the masking definition object. It's a part of the masking infrastructure and should be ignored. -