Set any repeating value

The Set any repeating value activity allows you to set a specific value of the desired type for repeating during package execution.

Table of contents
Usage
Example
Properties

Usage

To use the Set any repeating value activity, it must be placed inside a table masking activity or a similar activity that iterates over data. Once placed, a Select Types window will open where you must choose the TValue type, i.e. the type you want to generate. Selecting the Browse for Types... option will open the Browse and Select a .Net Type window where you can search for more types.

Select Types window Figure 1: Select Types window

After clicking OK, you can choose set the repeater properties. Set the RepeaterId as the ID of the repeater you want to add values to. Next, change the property RepeaterKey by selecting the ... button to choose from which table record properties will the key be composed of, up to a maximum of five properties. This will dictate by what key the new repeating value will be saved in the repeaters database. Lastly, add the function which will get the value by setting the GetValueFunc property. This can be done by either using a lambda expression to get the value from the record (e.g. record => record.Value) or using custom code to calculate the value. Either way, the function must return a string value.

Property Selector window Figure 2: Property Selector window

Example

Let's assume that we are masking the Transaction table where we mask everything except the Amount column. However, we will mask countries in another table that also contains transaction dates and descriptions, so we want to set repeater values with the transaction date and description as keys and country codes as values during masking of the Customer table. Furthermore, we want to increase the transaction amount by one hundred before saving it to the repeater.

First we place the Transaction masking activity and put the Set any repeating value masking activity within it. In the Select Types windows we choose Browse for Types... if decimal isn't suggested is not part of the list. In the Browse and Select a .Net Type window we find System.Decimal and choose it as the TValue. Then we can set the RepeaterId property to the ID of the repeater we are using, which is "AmountRepeater" in our case. Next, we create the RepeatingKey by selecting the ... button to open the Property Selector window where we can select the Date and Description properties and click OK. Lastly, we add the lambda expression record => record.Amount + 100.0M as the GetValueFunc to create the desired repeater value for every record.

Set any repeating value example Figure 3: Setting a decimal repeating value during masking

Properties

Property group Property name Description Example
Input: Repeating RepeaterId The ID of the repeater. "AmountRepeater"
RepeatingKey Repeating key to assign. item => CompositeKey.Create(item.Date, item.Description)
Misc DisplayName Display name of the activity in the workflow. Set any repeating value
GetValueFunc Lambda expression used to get the repeating value. item => item.Amount
Result Contains the masking definition object. It's a part of the masking infrastructure and should be ignored. -