Custom values
Custom values allow activity types to share data among themselves. The custom data is specific to the current enrollment and is only stored in the automation database. It is not intended as permanent storage. Store important information in another location or service (such as using the xConnect client).
Custom values are string key value pairs. Activities can both read and write custom values. Any other activity in the plan can then read and update these values.
A common use for custom values is to avoid repeating computations from one activity to another. For example, you may have an activity which searches the current interaction for a specific outcome. If the outcome is present, the activity can store relevant data about the outcome in custom values so other activities don’t need to search for the outcome, and can instead simply access the custom value directly.
Setting custom values
Setting custom values
Use the context.SetCustomValue(string,string) method inside the Invoke method.
Getting custom values
Getting custom values
Use the context.GetCustomValue(string,string) method inside the Invoke method.
Custom value lifetime
Custom value lifetime
Sitecore stores custom values with the enrollment in the Automation database. When you remove the enrollment, the activity returns SuccessExitPlan, and the system destroys the custom values data.