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.
- Target Collection: Select the destination (e.g.,
engagements,accounts,contacts). - JSON Mapping: Define how your CSV columns map to Firestore fields.
- Example:
{"Client Name": "name", "Client Email": "email"}.
- Example:
- 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.
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.
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--sincedate filter. By default, this connects to local Firebase emulators. To target a live database, use--projectto specify the Google Cloud environment and the--prodflag 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.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.
The Management CLI interacts directly with production data. Use requires authenticated gcloud credentials and is typically restricted to system administrators.
Related
Need more help?
Our support team is available to assist you.
Contact Support