Data API
Write Operations
Update Data

Update Data

The update_data() method modifies existing records in DealCloud. Writes are parallelized within create_concurrency and chunked by cellPaginationLimit (Advanced configuration); HTTP via intapp-rest-client.

Basic Update

from dealcloud_sdk import DealCloud, DealCloudConfig
 
config = DealCloudConfig(
    siteUrl="yoursite.dealcloud.com",
    clientId=12345,
    clientSecret="your-secret",
)
dc = DealCloud.from_config_object(config)
 
# Update records (requires EntryId)
updates = [
    {
        "EntryId": 12345,
        "Revenue": 1500000,
        "Status": 101
    },
    {
        "EntryId": 12346,
        "Revenue": 800000,
        "Status": 102
    }
]
 
result = dc.update_data("Company", updates)
⚠️

Every record must include EntryId (or a lookup column value when using use_dealcloud_ids=False).

Finding Entry IDs

From Previous Read

# Read, modify, update
companies = dc.read_data("Company", output="list", query="{Status: 'Pending'}")
 
updates = []
for company in companies:
    updates.append({
        "EntryId": company["EntryId"],
        "Status": 101  # Approved status ID
    })
 
dc.update_data("Company", updates)

Using Lookup Column

# Update by external ID
updates = [
    {
        "ExternalId": "CRM-001",  # Unique field
        "Revenue": 2000000
    }
]
 
dc.update_data(
    "Company",
    updates,
    use_dealcloud_ids=False,
    lookup_column="ExternalId"
)

Partial Updates

You only need to include fields you're changing:

# Only update Revenue - other fields unchanged
updates = [
    {"EntryId": 12345, "Revenue": 1500000},
    {"EntryId": 12346, "Revenue": 800000},
]
 
dc.update_data("Company", updates)

Clearing Field Values

To clear a field, set it to None:

# Clear the Description field
updates = [
    {"EntryId": 12345, "Description": None}
]
 
dc.update_data("Company", updates)

Input Formats

updates = [
    {"EntryId": 12345, "Status": 101},
    {"EntryId": 12346, "Status": 102},
]
dc.update_data("Company", updates)

Reference Field Updates

# Update reference by EntryId (default)
updates = [
    {
        "EntryId": 12345,
        "PrimaryContact": 67890  # Contact EntryId
    }
]
dc.update_data("Company", updates)
 
# Update by lookup value
updates = [
    {
        "EntryId": 12345,
        "PrimaryContact": "john.smith@example.com"  # Email lookup
    }
]
dc.update_data(
    "Company",
    updates,
    use_dealcloud_ids=False,
    lookup_column="Email"  # Lookup field on Contact
)

Multi-Select Updates

# Replace all values
updates = [
    {
        "EntryId": 12345,
        "Industries": [101, 102, 103]  # Replaces existing values
    }
]
dc.update_data("Company", updates)

Parameters

ParameterTypeDefaultDescription
object_idstr | intRequiredObject API name or ID
dataList[dict] | DataFrameRequiredRecords to update (accepts pandas or Polars)
use_dealcloud_idsboolTrueUse IDs vs lookup values
lookup_columnstrNoneField for record lookup
outputstr"list"Output format: "list", "write_result", "pandas", or "polars"
error_handlingErrorHandlingFAIL_FASTHow to handle transport errors in parallel batches
raise_on_row_errorsboolFalseWhen True, raise on row-level "Errors" in HTTP 200 body
progress_callbackCallableNoneProgress callback

Output Formats

# List (default)
result = dc.update_data("Company", updates)
 
# Pandas DataFrame
result = dc.update_data("Company", updates, output="pandas")
 
# Polars DataFrame  
result = dc.update_data("Company", updates, output="polars")

Error Handling

from dealcloud_sdk import ErrorHandling
 
# Collect transport errors (returns BatchResult)
result = dc.update_data(
    "Company",
    updates,
    error_handling=ErrorHandling.COLLECT
)
 
print(f"Updated: {len(result.results)}, row errors: {len(result.row_errors)}")
for record in result.row_errors:
    print(record["EntryId"], record["Errors"])

Common Update Errors

ErrorCauseSolution
Missing EntryIdNo identifier providedAdd EntryId or use lookup_column
Invalid referenceReference ID doesn't existVerify reference EntryId
Record not foundEntryId doesn't existVerify EntryId is correct

Typed Update

Using Pydantic models:

from pydantic import BaseModel
 
class Company(BaseModel):
    EntryId: int
    CompanyName: str
    Revenue: float
 
# Read as typed
companies = dc.typed_read_data(
    Company,
    object_id="Company",
    query="{Status: 'Active'}"
)
 
# Modify
for company in companies:
    company.Revenue *= 1.1  # 10% increase
 
# Update
result = dc.typed_update_data("Company", companies, Company)

Bulk Update Pattern

from dealcloud_sdk import DealCloud, DealCloudConfig
 
config = DealCloudConfig(
    siteUrl="yoursite.dealcloud.com",
    clientId=12345,
    clientSecret="your-secret",
)
dc = DealCloud.from_config_object(config)
 
# Efficient bulk update
def bulk_update_status(object_id: str, old_status: int, new_status: int):
    # Read affected records
    records = dc.read_data(
        object_id,
        output="list",
        fields=["EntryId"],
        query=f"{{Status: {old_status}}}"
    )
    
    if not records:
        return 0
    
    # Build updates
    updates = [{"EntryId": r["EntryId"], "Status": new_status} for r in records]
    
    # Update in batches (SDK handles this)
    dc.update_data(object_id, updates)
    
    return len(updates)
 
count = bulk_update_status("Company", old_status=201, new_status=202)
print(f"Updated {count} records")

Best Practices

  1. Include only changed fields - Don't send unchanged data
  2. Verify EntryIds exist - Read before update if unsure
  3. Use lookup columns for integrations - Easier to maintain external ID mappings
  4. Batch updates - Group related changes
  5. Handle errors gracefully - Use COLLECT for batch operations

Related