Loading

Opportunity Score (IqScore) field returns null when referenced in a record-triggered flow or trigger

Data pubblicazione: Jul 30, 2026
Descrizione

Einstein Opportunity Scoring populates a score on each scored Opportunity. This score is exposed through the Opportunity Score field, whose API name is IqScore (integer/number field).
The Opportunity Score field is a derived read-only field. Its value is not stored directly in the Opportunity table row; instead, it is calculated and returned only when the field is explicitly queried. Because the value is not part of the record's in-row data, it is not automatically loaded into the record in an automation's transaction context. As a result:

  • In a record-triggered flow, referencing the field through the triggering record variable ({!$Record.IqScore}) returns null.
  • In an Apex trigger, referencing the field through the trigger's new/old record context returns null.
  • In a SOQL query (or a Flow Get Records element), the field returns its correct value, because the query explicitly retrieves the derived value from the database.

Affected feature / product: Einstein Opportunity Scoring (Opportunity Score field) on the Opportunity object.
Conditions that trigger the issue:

  • Einstein Opportunity Scoring is enabled and the Opportunity has a valid score.
  • Automation (a record-triggered flow or Apex trigger) reads the Opportunity Score field directly from the triggering record rather than querying it.

Prerequisites to observe correct behavior: The Opportunity must be scored (a score must exist), and the running user must have access to Opportunity Scoring.

Important: Reading IqScore directly from the triggering record has never been a reliable way to obtain the score, because the field is derived. Customers may observe that this behavior appeared to work previously and then stopped; regardless of prior behavior, the supported method is to query the field explicitly as described below.

Risoluzione

To reliably obtain the Opportunity Score value in automation, query the field explicitly instead of reading it from the triggering record.
In a record-triggered flow:

  1. Do not reference {!$Record.IqScore} for the score value, as it will be null.
  2. Add a Get Records element after the flow is triggered.
  3. Configure Get Records to retrieve the Opportunity object filtered by Id Equals {!$Record.Id} (the triggering record's Id).
  4. Store the Opportunity Score (IqScore) field from that queried record.
  5. Reference the value retrieved by the Get Records element in your downstream logic (for example, when creating an Opportunity Score History record).

In Apex: Re-query the Opportunity with SOQL after the trigger fires (for example, SELECT Id, IqScore FROM Opportunity WHERE Id = :recordId) and use the queried value rather than the value from the trigger context.
This query-based approach is a supported and stable method for retrieving the Opportunity Score field value.
Fix / version information: This is expected behavior for a derived field; there is no code fix or patch required or planned. The query-based workaround above is the recommended long-term solution.

Risorse aggiuntive
    • Affected field API name: IqScore (field label: Opportunity Score) on the Opportunity object. It is a derived, read-only integer field.
    • Why direct reference returns null: Derived fields are not stored in the record row and are not automatically loaded into a transaction (flow/trigger) context. They materialize only when explicitly queried.
    • SOQL confirms data exists: A direct SOQL query on the Opportunity returns the correct score, confirming the field contains valid data and that only the direct in-context reference is affected.
    • Not caused by field configuration: The behavior is inherent to how the derived field loads, and is not caused by field-level automation-exclusion settings.
    • Scope: This behavior applies to both flows and Apex triggers; it is not specific to Flow.
    • Explicit platform error: In scheduled and record-triggered flows, the platform does not support derived fields in the $Record variable and may surface the following error: "The $Record.IqScore field contains a derived value that isn't supported. In a scheduled or record-triggered flow, $Record doesn't support some standard fields whose values are derived. Remove the $Record.IqScore field."
    • Root cause mechanism: The derived value is not populated in the record's transaction context by the time triggers or flows run — it is not resolved during the record load/creation step of the save order before flow execution. This is why the behavior is identical in Apex triggers and is not specific to Flow.
    • Longstanding limitation: This behavior has been observed in earlier cases as well, indicating that referencing $Record.IqScore directly has never been a supported method. The value should always be obtained via an explicit query (Get Records or SOQL).

Numero articolo Knowledge

005390248

 
Caricamento
Salesforce Help | Article