Loading

Einstein Opportunity Scoring: Opportunity Score (IqScore) Field Returns Null in a Record-Triggered Flow or Apex Trigger

Data pubblicazione: Nov 26, 2026
Descrizione

Einstein Opportunity Scoring populates a score on each scored Opportunity in Salesforce. The Opportunity Score field (API name `IqScore`, an integer field) is a derived, read-only field. Its value is not stored in the Opportunity row and is calculated only when the field is explicitly queried.

Because of this, the Opportunity Score field returns null when a record-triggered flow reads `{!$Record.IqScore}` or when an Apex trigger reads the field from the new or old record context. In a SOQL query or a Flow Get Records element, the field returns the correct value.

Conditions that trigger the issue: Einstein Opportunity Scoring is enabled, the Opportunity has a valid score, and automation reads the Opportunity Score field directly from the triggering record instead of querying it.

Prerequisites to observe correct behavior: The Opportunity must be scored, 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 notice that this appeared to work previously and then stopped. Regardless of prior behavior, the supported method is to query the field explicitly, as described in the Resolution.

Risoluzione

This article answers the question: why does the Opportunity Score (IqScore) field return null in a Salesforce record-triggered flow or Apex trigger, and how do you get its value? To reliably obtain the Opportunity Score value in automation, query the field explicitly instead of reading it from the triggering record.

How to Get the Opportunity Score in a Record-Triggered Flow

  1. Do not reference `{!$Record.IqScore}` for the score value, as it is 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).

How to Get the Opportunity Score in Apex

Re-query the Opportunity with SOQL after the trigger fires, and use the queried value rather than the value from the trigger context. The following query returns the Id and the Opportunity Score for the record. Replace recordId with the Id of the Opportunity.

SELECT Id, IqScore FROM Opportunity WHERE Id = :recordId

This query-based approach is a supported and stable method for retrieving the Opportunity Score field value.

Fix and Version Information for the IqScore Null Value

This is expected behavior for a derived field. No code fix or patch is required or planned. The query-based workaround above is the recommended long-term solution.

Why the Opportunity Score Field Returns Null in Flows and Triggers

  • 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 or trigger) context. They are populated only when explicitly queried.
  • SOQL confirms data exists: A direct SOQL query on the Opportunity returns the correct score, which confirms 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. Field-level automation-exclusion settings do not cause it.
  • 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 show 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 or creation step of the save order before flow execution. This is why the behavior is identical in Apex triggers.
  • Longstanding limitation: This behavior has been observed in earlier cases as well, so referencing `$Record.IqScore` directly has never been a supported method. Always obtain the value through an explicit query (Get Records or SOQL).
Numero articolo Knowledge

005390248

 
Caricamento
Salesforce Help | Article