Skip to main content

Overview

The Create or Update Data Source automation type automatically creates or updates records in a Data Source when a task is completed. This enables seamless data synchronization between task execution and external data management, allowing you to build dynamic databases that update based on field operations.
Create or Update Data Source automation configuration

Create or Update Data Source automation configuration showing Data Type selection, Primary Key configuration, and field mapping

When to Use Create or Update Data Source

Use this automation type when you need to:
  • Update customer databases after delivery completion
  • Create or update inventory records after field inspections
  • Sync task completion data with external data sources
  • Build dynamic databases that reflect field operation results
  • Maintain up-to-date records based on task outcomes

Event Availability

Create or Update Data Source automation type is available for:
  • On Task Finished - Create or update Data Source records when a task is completed
Note: This automation type is only available for the On Task Finished event, as it requires complete task data to update Data Source records accurately.

Configuration Fields

When you select Create or Update Data Source as the automation type, you need to configure the following:

1. Data Type *

Select the Data Type where records will be created or updated. Purpose:
  • Defines which Data Source will receive the data
  • Determines what fields are available for mapping
  • Controls the structure of created/updated records
How it works:
  • Choose from any Data Type configured in your organization
  • Once selected, the Data Type’s fields will appear for mapping
  • The system will use the Primary Key to determine whether to create or update

2. Primary Key *

Select the field that will be used as the unique identifier for matching records. Purpose:
  • Determines how the automation identifies existing records
  • Controls create vs. update behavior
  • Ensures data integrity and prevents duplicates
How it works:
  • Select a field from the Data Type that serves as a unique identifier
  • When a task finishes, the automation checks if a record with this Primary Key value exists:
    • If exists: Updates the existing record
    • If not exists: Creates a new record
  • Common Primary Key fields: Customer Name, Customer ID, Order Number, etc.

3. Field Mapping

After selecting the Data Type and Primary Key, you’ll see all the fields from that Data Type. For each field, you can: Option A: Manual Input
  • Type a static value directly into the field
  • Useful for default values that don’t change
Option B: Field Reference
  • Click the search icon next to the field
  • Select a field from the trigger Flow to map its value
  • The value from the completed task will be copied to the Data Source
Option C: Leave Empty
  • Fields can be left empty if they are optional
  • Required fields must be filled either manually or via reference
Example Mapping:
  • Customer Address (Data Source) → Customer Address (from Delivery task)
  • Customer Coordinate (Data Source) → Delivery Coordinate (from Delivery task)
  • Last Delivery Date (Data Source) → Completion Date (from task)

Use Cases

1. Customer Database Update After Delivery

Scenario: Update customer information in a central database when delivery tasks are completed. Configuration:
  • Event: On Task Finished
  • Flow (Trigger): Delivery
  • Automation Type: Create or Update Data Source
  • Data Type: Customer Database
  • Primary Key: Customer Name
  • Field Mapping:
    • Customer Address → Customer Address (from Delivery)
    • Customer Coordinate → Delivery Coordinate (from Delivery)
    • Last Delivery Date → Completion Date (from Delivery)
    • Customer Phone → Customer Phone (from Delivery)
Benefit: Automatically maintains up-to-date customer records without manual data entry.

2. Inventory Update After Stock Check

Scenario: Update inventory records when field inspection tasks are completed. Configuration:
  • Event: On Task Finished
  • Flow (Trigger): Stock Inspection
  • Automation Type: Create or Update Data Source
  • Data Type: Inventory Database
  • Primary Key: Product ID
  • Field Mapping:
    • Product Name → Inspected Product (from Stock Inspection)
    • Current Stock → Stock Count (from Stock Inspection)
    • Last Inspection → Completion Date (from task)
    • Warehouse Location → Inspection Location (from Stock Inspection)
Benefit: Real-time inventory tracking based on field inspections.

3. Service History Tracking

Scenario: Create service history records for each completed service task. Configuration:
  • Event: On Task Finished
  • Flow (Trigger): Home Cleaning
  • Automation Type: Create or Update Data Source
  • Data Type: Service History
  • Primary Key: Service ID (auto-generated from task)
  • Field Mapping:
    • Customer Name → Customer Name (from Home Cleaning)
    • Service Date → Completion Date (from task)
    • Service Type → Service Category (from Home Cleaning)
    • Technician → Assignee (from task)
Benefit: Automatic service history creation for customer relationship management.

4. Sales Lead Database from Canvassing

Scenario: Create or update sales lead records from field canvassing activities. Configuration:
  • Event: On Task Finished
  • Flow (Trigger): Field Canvassing
  • Automation Type: Create or Update Data Source
  • Data Type: Sales Leads
  • Primary Key: Prospect Name
  • Field Mapping:
    • Prospect Name → Canvassed Name (from Field Canvassing)
    • Contact Number → Phone Number (from Field Canvassing)
    • Interest Level → Survey Result (from Field Canvassing)
    • Last Contact Date → Completion Date (from task)
    • Canvasser → Assignee (from task)
Benefit: Automated lead generation and tracking from field activities.

How It Works

  1. Task Completion: A task in the configured Flow is completed
  2. Rules Evaluated: If Rules are configured, they are checked against the task data
  3. Automation Triggers: The Create or Update Data Source automation is activated
  4. Primary Key Check: The automation checks if a record with the Primary Key value exists
  5. Create or Update Decision:
    • If record exists: Updates the existing record with mapped field values
    • If record doesn’t exist: Creates a new record with mapped field values
  6. Data Synced: The Data Source is updated and reflects the latest task completion data

Field Mapping Best Practices

Understanding Field Types

When mapping fields from the trigger Flow to the Data Source: Direct Mapping:
  • Map fields with similar data types (text to text, coordinate to geolocation)
  • Example: Customer Name → Customer Name
Cross-Component Mapping:
  • You can map any field from trigger task to any field in Data Source
  • Example: Delivery Date → Last Updated Date
Static Values:
  • Use for fields that should always have the same value
  • Example: Record Type → “Customer” (always set to Customer)
Optional vs Required:
  • Required fields in Data Type must be filled
  • Optional fields can be left empty

Field Mapping Strategies

  1. Complete Mapping: Map all relevant fields for comprehensive data capture
  2. Partial Mapping: Map only essential fields, leave others for manual input later
  3. Hybrid Approach: Map some fields automatically, add static defaults for others

Important Notes

Create vs. Update Behavior

  • Primary Key Matching: The automation uses the Primary Key to determine if a record exists
  • Update Strategy: If a record exists, only mapped fields are updated (unmapped fields remain unchanged)
  • Create Strategy: If no record exists, a new record is created with mapped field values
  • Data Integrity: Primary Key must be unique to ensure proper matching

Data Source Requirements

  • The Data Type must exist before creating the automation
  • Primary Key field should be configured in the Data Type
  • User must have permissions to create/update records in the Data Source
  • Data Type fields should match or be compatible with Flow fields being mapped

Best Practices

  1. Choose Unique Primary Keys: Select fields that uniquely identify records (Customer ID, Order Number, etc.)
  2. Map Essential Fields: Focus on fields that provide meaningful data for your Data Source.
  3. Use Field References: Prefer field references over manual input to ensure data consistency.
  4. Test with Sample Tasks: Create test tasks to verify field mapping works correctly before activating.
  5. Document Automation Purpose: Use clear automation names (e.g., “Update Customer DB when Delivery Finished”).
  6. Leverage Rules: Combine with Rules to update Data Source only when specific conditions are met.
  7. Monitor Data Quality: Regularly review Data Source records to ensure automation is working as expected.
  8. Handle Common Data: For organization-wide data (common data), ensure the Data Type is configured as common data.

Advanced Configuration

Limit User (Access Control)

The automation supports access control for created/updated Data Source records: Option A: Static User List
  • Specify users who can access the record
  • Example: ["user1@example.com", "user2@example.com"]
Option B: Dynamic User Assignment (limitType)
  • assignee - Grants access to the task assignee
  • assignedBy - Grants access to the user who assigned the task
  • doneBy - Grants access to the user who completed the task
Update Strategies:
  • updateLimitUser: Merges new users with existing access list
  • replaceLimitUser: Replaces entire access list with new users

Validation and Error Handling

  • Data Type field validation rules are enforced
  • Required fields must have values (mapped or static)
  • Field type validation ensures data compatibility
  • Failed automations can be retried (max 2 attempts)

Troubleshooting

Issue: Data Source record is not being created or updated Possible Causes:
  • Automation is not set to Active
  • Task Flow does not match automation configuration
  • Rules exclude the completed task
  • Primary Key field is empty in the task
  • Required Data Type fields are not mapped
Solution:
  • Verify automation toggle is ON
  • Check Event and Flow settings match trigger
  • Review Rules for conflicts
  • Ensure Primary Key field has a value in completed tasks
  • Ensure all required Data Type fields have values (mapped or static)
Issue: Record is always created instead of updated Possible Causes:
  • Primary Key value in task doesn’t match existing records
  • Primary Key field mapping is incorrect
  • Case sensitivity in Primary Key matching
Solution:
  • Verify Primary Key values match exactly (including case)
  • Check Primary Key field mapping configuration
  • Review existing Data Source records for matching Primary Keys
Issue: Some fields are not being updated Possible Causes:
  • Fields are not mapped in automation configuration
  • Source task field is empty
  • Field type mismatch
Solution:
  • Verify all desired fields are mapped in automation
  • Check that source task has values in mapped fields
  • Ensure field types are compatible
Issue: Wrong Data Type is being updated Possible Causes:
  • Incorrect Data Type selected in automation
  • Multiple automations with different Data Types
Solution:
  • Edit automation and verify correct Data Type is selected
  • Review all automations for the same event
Issue: Access control not working as expected Possible Causes:
  • limitUser or limitType not configured
  • User doesn’t have permissions to Data Type
  • Common data configuration mismatch
Solution:
  • Configure limitUser or limitType in automation details
  • Grant appropriate Data Type permissions to users
  • Verify Data Type common data setting matches requirements

Frequently Asked Questions

Q: What’s the difference between Create or Update Data Source and Create Task? A: Create or Update Data Source modifies Data Source records based on task completion. Create Task creates a new task in a Flow. Use Create or Update Data Source for managing structured data records, and Create Task for workflow chains. Q: Can I update multiple Data Sources with one automation? A: No, each automation updates one Data Source (Data Type). To update multiple Data Sources, create separate automation rules for each. Q: What happens if the Primary Key field is empty in the completed task? A: If the Primary Key field is empty, the automation may fail or create a record with an empty Primary Key (depending on Data Type validation). Ensure Primary Key fields always have values. Q: Can I use Create or Update Data Source for events other than On Task Finished? A: No, Create or Update Data Source is only available for On Task Finished event. For other events, use Webhook to integrate with external systems. Q: How does the automation know whether to create or update? A: The automation queries the Data Source using the Primary Key value from the completed task. If a record with that Primary Key exists, it updates; otherwise, it creates a new record. Q: Will field validation rules from the Data Type be applied? A: Yes, all Data Type field validation rules apply to automatically created/updated records. If validation fails, the automation will fail. Q: Can I map the same task field to multiple Data Source fields? A: Yes, you can map the same source field to multiple destination fields in the Data Source. Q: What happens if I change the Primary Key field in the automation configuration? A: Changing which field is used as the Primary Key (e.g., from Customer Name to Customer ID) will affect how records are matched. Existing records matched by the old Primary Key field will no longer be updated. Instead, new records will be created when tasks complete. Change Primary Key fields with caution as this can result in duplicate records. Q: How can I see if the automation succeeded or failed? A: Check the automation logs (click the clock icon on the automation list) to see execution history, success/failure status, and error messages. Q: Can I use this to delete Data Source records? A: No, this automation only creates or updates records. To delete records, use the Data Source API or manual deletion in the web interface.