Newer Version Available

This content describes an older version of this product. View Latest

AIRecordInsight

Represents an Einstein prediction insight. This object is available in API version 47.0 and later.

An Einstein insight is created every time an Einstein feature, such as Prediction Builder or Case Classification, makes a prediction. An insight is represented by a root AIRecordInsight and the following child objects: AIInsightAction, AIInsightFeedback, AIInsightReason, and AIInsightValue.

AIRecordInsight contains information on the Einstein prediction, the AI prediction field where results were written to, and additional details such as the type of prediction.

Supported Calls

delete(), describeSObjects(), getDeleted(), getUpdated(), query(), retrieve(), undelete()

Special Access Rules

Prediction insight objects are only available in orgs that have Einstein features, such as Prediction Builder or Case Classification, enabled.

Fields

Field Details
Confidence
Type
double
Properties
Filter, Nillable, Sort
Description
Relative confidence strength of the generated prediction insight, from 0.0 to 1.0. Higher values (near 1.0) indicate stronger confidence.
Name
Type
string
Properties
Autonumber, Defaulted on create, Filter, idLookup, Sort
Description
The name of the AIRecordInsight.
RunGuid
Type
string
Properties
Filter, Group, Sort
Description
A unique identifier for the Einstein process that made the prediction.
RunStartTime
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The date and time the Einstein prediction process was started.
Status
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The status of this insight. Possible values are:
  • Defunct—The insight has been consumed by the Einstein feature that owns the prediction. For example, Case Classification will mark an insight as defunct if a predicted recommendation was presented to a user and the user either accepted or ignored the recommendation. This ensures that the same recommendation is not presented multiple times to the user.
  • New—The insight has not been consumed by the Einstein feature.
TargetField
Type
picklist
Properties
Filter, Group, Nillable, Restricted picklist, Sort
Description
The name of the field Einstein is making predictions for, such as “AnnualRevenue”.
TargetId
Type
reference
Properties
Filter, Group, Sort
Description
The unique ID of the record Einstein is making predictions for.
TargetSobjectType
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
The type of the target object, such as Account or Case.
Type
Type
picklist
Properties
Filter, Group, Restricted picklist, Sort
Description
The type of insight. Possible values are:
  • Action—An insight that indicates a suggested action, such as sending an email.
  • Lookup—An insight that indicates a related value not directly related to the target object and field.
  • MultiValue—An insight with multiple values, such as a multi-class classification.
  • SimilarRecord—An insight that indicates similar or duplicate records.
  • SingleValue—A single value insight, such as a regression number or a score.
ValidUntil
Type
dateTime
Properties
Filter, Nillable, Sort
Description
The day and time this insight is valid until. After this day and time, the insight might no longer be valid due to new prediction results from new or changed data. If this field is null, this insight never expires.

Usage

When an Einstein feature makes a prediction and saves the results, the following events happen in a single atomic operation:
  • An AIRecordInsight record is created and populated with information about the prediction insight. AIInsightAction, AIInsightReason, and AIInsightValue records are also created and made children of the AIRecordInsight record.
  • If the Einstein feature uses AI prediction fields, prediction result values are written to the target AI prediction field.
  • An AIPredictionEvent platform event is created, and any subscriber to AIPredictionEvent is notified.
Note that when Einstein writes prediction results back to AI prediction fields, record save custom logic, such as Apex triggers, workflow rules, and assignment rules, aren’t run. To add custom logic based on Einstein prediction results, use a platform event subscriber, such as Process Builder, to get notifications for AIPredictionEvents which contain references to Einstein insight objects.

Custom fields cannot be added to Einstein insight objects.

Einstein insights contain information about target fields and predicted value. Be aware that your org may have created Einstein predictions that are associated with target fields with field-level security restrictions. Use data access features of Salesforce, such as user profiles and permission sets if you need to control how users access Einstein insights records.