Custom lead scoring formula in Application Composer not triggering on record update

We’ve configured a custom Groovy formula in Application Composer to calculate lead scores based on engagement metrics (email opens, website visits, demo requests). The formula works correctly when creating new leads, but it doesn’t recalculate when we update dependent fields like EmailEngagementScore or WebsiteActivityCount.

Formula definition:

def score = (EmailEngagementScore * 0.3) +
            (WebsiteActivityCount * 0.4) +
            (DemoRequested ? 30 : 0)
return score

The formula is set on the LeadScore field with trigger type ‘Always’. We’ve verified that dependent fields are being updated successfully through our integration, but the LeadScore field retains its old value. We’re unsure if this is a formula trigger configuration issue, a problem with how dependent fields are mapped, or if there’s a difference in behavior between create and update lifecycles. Should we be using scheduled recalculation instead of real-time triggers?

Here’s a comprehensive solution covering all aspects of your formula trigger issue:

1. Formula Trigger Configuration: First, properly configure your formula triggers in Application Composer:

  • Navigate to Lead object → LeadScore field → Formula Properties
  • Change trigger type from ‘Always’ to ‘When Dependent Fields Change’
  • In the Recalculation Triggers section, explicitly add:
    • EmailEngagementScore
    • WebsiteActivityCount
    • DemoRequested

This ensures the formula recalculates whenever any of these three fields are modified.

2. Dependent Field Mapping: Verify your field mapping configuration:

// In Application Composer, edit your formula and add explicit dependencies:
formula: {
  expression: "(EmailEngagementScore * 0.3) + (WebsiteActivityCount * 0.4) + (DemoRequested ? 30 : 0)"
  dependsOn: ["EmailEngagementScore", "WebsiteActivityCount", "DemoRequested"]
  recalculateOn: "DEPENDENT_FIELD_UPDATE"
}

The key is setting recalculateOn to trigger on dependent field updates, not just direct LeadScore modifications.

3. Create vs Update Lifecycle Behavior: Understand the different behaviors:

  • Create lifecycle: All formulas execute automatically, regardless of trigger configuration
  • Update lifecycle: Only formulas with explicit triggers execute
  • API updates: By default, skip formula execution unless explicitly requested

For your REST API integration, modify your update requests:

// Add query parameter to force formula execution
PATCH /crmRestApi/resources/11.13.18.05/leads/{id}?onlyData=false

The onlyData=false parameter instructs CX Cloud to execute all business logic including formulas, validations, and triggers during the update.

Alternatively, use the header approach:

Headers: {
  "X-Recalculate-Formulas": "true"
}

4. Scheduled Recalculation Implementation: As a backup mechanism and for data consistency, implement scheduled recalculation:

Create a scheduled process in Application Composer:

  • Go to Application Composer → Scheduled Processes → Create New
  • Name: “Recalculate Lead Scores”
  • Frequency: Every 4 hours (or based on your SLA requirements)
  • Groovy script:
def leads = adf.util.query("Lead", "ModifiedDate >= SYSDATE-1/6")
leads.each { lead ->
  lead.recalculateFormulas(["LeadScore"])
}

This ensures any missed calculations are corrected within your defined window.

Additional Best Practices:

Testing the Configuration:

  1. Test direct UI update: Manually update EmailEngagementScore in UI and verify LeadScore recalculates
  2. Test API update: Update via REST API with onlyData=false and verify formula execution
  3. Test scheduled job: Run the scheduled process manually and check recalculation logs

Performance Considerations:

  • Real-time formula execution adds latency to API updates (typically 200-500ms)
  • For high-volume integrations, consider batching updates and using scheduled recalculation
  • Monitor formula execution time in diagnostic logs

Troubleshooting: If formulas still don’t trigger after configuration:

  • Check Application Composer logs for formula execution errors
  • Verify field data types match formula expectations (nulls can cause silent failures)
  • Ensure your API user has permissions to execute formulas
  • Test with a simple formula first (e.g., return 100) to isolate logic issues from trigger issues

Migration Note: If you’re upgrading from an earlier version of CX Cloud, formula trigger behavior changed in 23C. Review all existing formulas and explicitly configure dependencies that were previously implicit.

With these configurations in place, your lead scoring formula will reliably recalculate on both create and update operations, whether initiated through the UI, API, or scheduled jobs.


This draft is based on general Oracle CX Cloud knowledge. It has not been verified against your specific version and environment. Practitioners: verify the steps and share your experience below.

The ‘Always’ trigger type only fires on explicit field updates, not when dependent fields change. You need to explicitly declare field dependencies in your formula configuration. Check the ‘Depends On’ section in Application Composer and add EmailEngagementScore, WebsiteActivityCount, and DemoRequested as dependencies.

I don’t see a ‘Depends On’ section in the formula editor. Are you referring to the field dependencies in the object definition? How do I configure that?

“Tested this on Oracle CX Sales 23D and switching LeadScore’s trigger from ‘Always’ to ‘When Dependent Fields Change’ with explicit EmailEngagementScore dependency immediately resolved our stale scoring issue.”

In Application Composer, navigate to your Lead object, select the LeadScore field, and look for ‘Recalculation Triggers’ in the formula properties. You need to add the three dependent fields there. However, there’s also a known issue where formulas don’t trigger on updates from REST API integrations unless you explicitly set the recalculation flag in the API payload. Are your updates coming from an integration?

Yes, updates are coming from our marketing automation integration via REST API. How do we set the recalculation flag? Is that a parameter in the API request?

You need to include a header or query parameter to force formula recalculation. In your REST API update request, add the query parameter ‘onlyData=false’ which tells CX Cloud to execute all triggers and formulas. By default, API updates skip formula execution for performance reasons.

There’s also the create vs update lifecycle difference to consider. On create, all formulas run automatically. On update, only formulas with proper trigger configuration execute. You might want to implement a scheduled job for batch recalculation as a backup mechanism, especially if real-time updates prove unreliable.