Data Import & CLI

Bulk-import engagements, accounts, and resources from CSV with dynamic field mapping. Run server-side migrations and admin tasks through the Servantium Management CLI.

Quickstart

Use the Dataload tab in Settings for bulk CSV imports. For advanced server-side tasks, use the Python-based Management CLI.

In-Depth

Servantium provides robust tools for moving data in and out of the system, whether you’re performing a one-time migration or regular bulk updates.

Dataloads (CSV Import)

The Dataload system is the primary way for administrators to import historical engagements, client lists, or resource pools.

  1. Target Collection: Select the destination (e.g., engagements, accounts, contacts).
  2. JSON Mapping: Define how your CSV columns map to Firestore fields.
    • Example: {"Client Name": "name", "Client Email": "email"}.
  3. Upload & Process: Once uploaded, toggle the Load flag. A background Cloud Function (dataloadTrigger) will process the rows asynchronously.

Dynamic Formulas

You can transform or combine CSV column data during import using string interpolation formulas.

  • Syntax: Use single braces for column substitution (e.g., {First Name} {Last Name}). You can also slice strings using slice notation (e.g., {Account ID[0:15]} to extract the first 15 characters).
  • Fallbacks: Use the pipe character | to provide fallback expressions if a value is empty (e.g., {Primary Email}|{Secondary Email}|No Email). The system evaluates from left to right and returns the first non-empty result.
  • External IDs: If you need to generate a unique composite ID to prevent duplicates, you can use formulas in the external ID mapping column.

Cascade Syncs

When importing data, you can configure your mapping to automatically trigger outbound integration syncs when specific fields change. By defining a cascades array in your mapping, the system monitors imported records for changes to the specified onFieldsChanged fields. If a change is detected, it automatically dispatches a targeted integration sync for that specific record to your external system (like Salesforce).

Error Reporting and Auditing

Every row in your import is tracked. Results and specific failure reasons are recorded in the dataload_results collection, allowing you to fix errors in your source file and re-import only the failed rows.

Parent Dependencies

If an imported record references a parent document that has not been created yet, the import will not fail. Instead, its status automatically changes to Pending Parent Document. Once the missing parent record is created or imported, the system detects it and automatically resumes processing for the waiting row.

Management CLI

For system operators and developers, the Management CLI (management_tasks/cli.py) provides direct access to backend operations:

  • create_org.py: Provision new organizations and link administrative owners.
  • force_sync_collection.py: Force an outgoing integration sync on all documents in a specific collection, with an optional --since date filter. By default, this connects to local Firebase emulators. To target a live database, use --project to specify the Google Cloud environment and the --prod flag to explicitly authorize connecting to production.
  • load_users.py: Bulk provision and invite user accounts from a CSV list.
  • migrate_quotes.py: Perform structural data migrations across all quotes within an organization.
  • reconcile_actuals.py: Wipe and re-fetch actual hours for specific out-of-sync projects from an external system. Use --external_ids to target project Salesforce IDs, alongside --org, --integration_id, and --mapping_id.
  • reindex_algolia.py: Force a full synchronization of your Firestore data to the Algolia search index.
  • update_algolia_security_tags.py: Backfill security tags for existing Algolia records to enforce Attribute-Based Access Control (ABAC) search filtering.
  • zero_out_hours.py: Bulk zero out hours for specific Resource Plan assignments. Use --external_ids to target plans, and optionally filter by organization using the --org parameter.
Caution

The Management CLI interacts directly with production data. Use requires authenticated gcloud credentials and is typically restricted to system administrators.

Need more help?

Our support team is available to assist you.

Contact Support