Create mock Salesforce contact data on schedule

CRMMarketingRecipe Tools

What it does

When a scheduled search runs a SOQL query in Salesforce to find contacts, this automation loops through each result and accumulates them into a list. It then updates all contacts in bulk and logs the job outcome so someone knows the batch completed.

Who it's for

Engineering and QA teams who need to generate test contact data in Salesforce for development and testing.

Apps used

How teams use this

Generate test contacts for QA cycles

Run the scheduled search to create mock contact records in a Salesforce sandbox. The team uses these records to test integrations without affecting production data.

Refresh test data nightly for testing

Set the schedule to run every night so fresh mock contacts are available each morning. The bulk update keeps the dataset current for daily testing cycles.

Filter contacts by region before update

Add a condition to the SOQL query to only include contacts from a specific region. This lets the team test region-specific logic without processing the entire contact base.

Sync test data to staging environment

Set the automation to run on a schedule and update contacts in a staging Salesforce org. This keeps test data synchronized across environments so staging matches production structure.

How it works

  1. Search contacts on a schedule. Run a scheduled SOQL query in Salesforce to find contacts that match the WHERE clause criteria at the set time each day.
  2. Loop through each contact. For each contact returned from the Salesforce search, add it to the emailList so all results are collected before the bulk update runs.
  3. Update all contacts at once. When the first batch completes, update all contacts in bulk in Salesforce so changes apply to the entire set in one operation.
  4. Log the job result. Write a message to the job report in Salesforce so someone can review whether the batch ran successfully and how many contacts were processed.