Exercise - Configure auditing, duplicate detection, and bulk deletion

Completed

In this exercise, you configure auditing, duplicate detection, and bulk deletion for a Dataverse environment. These core data governance capabilities help administrators maintain regulatory compliance, ensure data quality, and manage storage efficiently.

For Zava, these configurations are critical. The Zava Pay application processes payment data subject to PCI-DSS requirements, which mandate audit trails for data access and changes. Duplicate detection prevents inconsistent customer records that could cause payment processing errors, and bulk delete jobs keep storage lean by removing stale records on a schedule.

This exercise takes approximately 30 minutes to complete.

Prerequisites

To complete this exercise, you need:

Enable and configure auditing

Auditing creates an immutable record of who changed what, and when. For PCI-DSS compliance, Zava must capture both data modifications and sign-in events across their payment-related environments.

Enable environment-level auditing

  1. Open the Power Platform admin center.
  2. In the left navigation, select Environments.
  3. Select the environment you want to configure.
  4. In the environment detail page, select Settings from the top menu bar.
  5. Expand Audit and logs and select Audit settings.
  6. Check the box for Start Auditing.
  7. Check the box for Log access to capture sign-in events.
  8. Set the Retain these logs for value to 180 days.
  9. Select Save.

Tip

The 180-day retention period aligns with common compliance frameworks. Your organization might require longer retention based on specific regulatory requirements.

Enable table-level auditing

  1. Open Power Apps and ensure your target environment is selected in the environment picker at the top right.
  2. In the left navigation, under the Dataverse section, select Tables.
  3. Find and select the Contact table.
  4. Select Properties in the command bar (or Edit table properties).
  5. Expand the Advanced options section.
  6. Check the box for Audit changes to its data.
  7. Select Save.

Enable column-level auditing

  1. With the Contact table still open, select the Columns tab.
  2. Find and select the Email column to open its properties.
  3. Expand the Advanced options section.
  4. Check the box for Enable auditing.
  5. Select Save.

Verify audit is capturing changes

After enabling auditing, confirm that changes are logged correctly. This verification step ensures your compliance configuration is working before you depend on it.

  1. In Power Apps, go to Contacts by using the left navigation or by opening a model-driven app that includes the Contact table.
  2. Create a new contact or open an existing contact record.
  3. Change the Email field to a new value and select Save.
  4. On the same contact record, select Related > Audit History from the command bar or the related tab.
  5. Verify that the audit log shows an entry with:
    • The old value and new value for the email field
    • A timestamp for when the change occurred
    • The user who made the change

Note

If the audit history doesn't appear immediately, wait a moment and refresh the page. There might be a brief delay before new audit entries are visible.

Create a duplicate detection rule

Duplicate records create data quality problems that can lead to payment errors in regulated environments. A duplicate detection rule for the Contact table's email address helps prevent entering the same customer multiple times.

  1. Open the Power Platform admin center.
  2. In the left navigation, select Environments, and then select your environment.
  3. Select Settings from the top menu bar.
  4. Expand Data management and select Duplicate detection rules.
  5. Select + New from the command bar.
  6. Enter the following values:
    • Name: Contact - Duplicate email address
    • Base Record Type: Contact
    • Matching Record Type: Contact
  7. In the Duplicate Detection Rule Criteria section, add a condition:
    • Column: Email Address
    • Criteria: Exact Match
    • Check Ignore Blank Values
  8. Select Save and Close.
  9. In the duplicate detection rules list, select the rule you just created.
  10. Select Publish from the command bar.
  11. Wait for publishing to complete - the system generates matchcodes for all existing contact records.

Note

Publishing might take a few minutes depending on the number of existing contact records. The rule status changes to Published when complete.

Test duplicate detection

Verify that the rule prevents duplicate contacts from being saved without review.

  1. In Power Apps, go to the Contacts table or open a model-driven app that includes contacts.
  2. Select + New to create a new contact.
  3. Enter an Email address that matches an existing contact record.
  4. Select Save.
  5. Verify that a Duplicate records found dialog appears, showing the existing matching contact.
  6. Select Cancel (or Ignore and save if you want to test both paths) to discard the duplicate.

You should see the duplicate warning clearly identifying which existing record matches and why. This information helps users decide whether to merge, update, or discard the new record.

Configure a bulk delete job

Bulk delete jobs remove records that match specific criteria. They help manage storage costs and enforce data retention policies. For Zava, removing inactive contacts older than two years reduces the volume of data subject to compliance obligations.

  1. Open the Power Platform admin center.
  2. In the left navigation, select Environments, and then select your environment.
  3. Select Settings from the top menu bar.
  4. Expand Data management and select Bulk Record Deletion.
  5. Select New from the command bar to open the Bulk Delete wizard.
  6. Define the query criteria:
    • Look for: Contacts
    • Add condition: Status equals Inactive
    • Add condition: Modified On is Older Than X Months - set the value to 24
  7. Select Next.
  8. Enter the job name: Delete inactive contacts older than 2 years
  9. Set the Email notification to your administrator email address.
  10. For this exercise, choose Run once.
  11. Select Submit to create the job.

Tip

In a production environment, you schedule this job to run on a recurring basis (for example, weekly) to continuously clean up stale records. Recurring schedules ensure storage stays optimized without manual intervention.

After submitting, you can monitor the job's progress in the System Jobs view. The job reports how many records it deleted upon completion.

Success criteria

Before completing this exercise, confirm the following criteria:

  • Auditing is enabled at the environment level with 180-day retention.
  • The Contact table has auditing enabled.
  • The Contact Email column has column-level auditing enabled.
  • Audit history shows changes made to a Contact record.
  • A duplicate detection rule for Contact email is published.
  • Duplicate warning appears when creating a contact with an existing email.
  • A bulk delete job is configured for inactive contacts.