1. xConnect DevEx CLI plugin

The CLI purge contacts command

Version:

The xConnect DevEx CLI plugin includes a purge command with a contacts subcommand. This command initiates a purge process based on the provided CutoffDays and conditions.

Usage

You can use the command as follows:

sitecore xconnect purge contacts [subcommand] [options]

Subcommands

You can use the following subcommands:

SubcommandDescription
startRegister a purge contacts task.

Options

You can use the following options with the command:

OptionRequired?Description
-c, --configYesThe path to the sitecore.json configuration file (default: cwd). A DevEx CLI standard option.
-n, --environment-nameYesThe Sitecore environment to use. Default: default. A DevEx CLI standard option.
-d, --cutoffdaysYesThe number of days the contact has not interacted with the brand. For example, -d 190.
Note

This option is the only requirement with no default value.



There is a list of restrictions for the cutoffdays option:

--sp, --start-percentileNoThe range-bound start percentile for the data extraction. For example, --sp 0.

There is a list of restrictions for the start-percentile option:

  • You must specify both the start and end percentile or none of them.
  • The range-bound for both is between 0 and 1.
  • The start-percentile must be lower than the end-percentile.
--ep, --end-percentileNoThe range-bound end percentile for data extraction. For example, --ep 1.

There is a list of restrictions for the end-percentile option:

  • You must specify both the start and end percentile or none of them.
  • The range-bound for both is between 0 and 1.
  • The end-percentile must be higher than the start-percentile.
--cds, --conditionsNoA comma-separated list of additional filter conditions for a contacts purge. Conditions can be customized and registered for further data filtering. For example, --cds AnonymousCondition.

The task registration fails if a non-existing condition is specified. A list of unfound conditions is in the CLI output.

See Walkthrough: Customizing contact purge conditions for more details about limits and how to create custom conditions.
-b, --batch-sizeYesThe batch size for contact data extraction the purge task uses. For example, -b 200.
-v, --verboseNoReport additional diagnostic and performance data.
-t, --traceNoReport additional diagnostic and performance data.
--confirmNoConfirm all prompts automatically.
-?, -h, --helpNoHelp for the command.

Examples

The following are examples of the purge contacts command use:

sitecore xconnect purge contacts start -d 180

sitecore xconnect purge contacts start -d 180 --sp 0 --ep 1 -b 200 --cds AnonymousCondition --trace --verbose

Confirm or cancel task registration

The purge contacts start command sends a confirmation to the end-user that this command causes data deletion.

The user can confirm task registration by entering Y or y:

A successful task registration returns a task ID that you can keep for further actions, such as getting the task status or canceling the task.

The user can also cancel the task registration with N or n. Any other character entries lead to the cancellation of the task registration with a corresponding notification that the confirmation response was invalid.

You may use option --confirm for silent confirmation of the task registration. In that case, you do not receive any prompts.

The result of the successful task registration is the task ID and sample commands for canceling and getting the status of the purge task.

If you have suggestions for improving this article, let us know!