When you use Einstein Prediction Builder to build a prediction, a custom field is created for storing and displaying the prediction scores on records. Or, you can create a predictive custom field manually, and enter its name and label when building a prediction in Einstein Prediction Builder.
We recommended that you create a custom field for storing prediction scores through the setup flow in Einstein Prediction Builder, which creates the field for you. If you choose to manually create the custom field instead, choose the Number type. When you name the field, select the AI Prediction checkbox. After the field is enabled, use Einstein Prediction Builder to build a prediction, entering the custom field's exact name and label when setting up the location for storing your prediction scores.
When you let Einstein Prediction Builder create the field for you while building a prediction, it ensures proper scale and precision. If you manually create the field and try to use it when building a prediction, you may get an error message if the custom field is invalid. When creating the custom predictive field manually, be sure to give field-level security permissions to the Admin role. Otherwise, prediction scores won't be able to be stored in this field.
Using an AI Prediction Field in a Custom Formula Field
Custom formula fields can also reference AI prediction fields. For example, create a number field to predict the payment for a service named LikelyCost__c. Select the AI Prediction checkbox. Then, create a formula field called InitialOffer__c with a formula of LikelyCost__c * 1.5. In this case, LikelyCost__c is a numeric AI Prediction field and InitialOffer__c is just a custom formula field. Once the field is used in a prediction, the resulting value is powered by Einstein Prediction Builder.
Considerations for AI Prediction Fields and Custom Formula Fields
Whether Einstein Prediction Builder creates the field for you, or you do it on your own, these fields have some limitations. These limitations apply to both AI prediction fields and custom formula fields that reference AI prediction fields.
- An AI prediction field can be used for only one prediction. Once it’s being used for a prediction, whether created automatically or manually, you can’t use it for another prediction.
- The field value changes only when new predictions are made about the corresponding object. Value changes in this field do not trigger Process Builder, Apex triggers, or workflows.
- The Roll-Up Summary field type doesn’t support AI prediction fields.
- Fields enabled as AI prediction fields included in packages aren’t uploaded, so they can’t be distributed in packages.
- We don’t recommend using a custom number field that Einstein Prediction Builder manages in a validation rule. If the prediction changes the field value in a way that violates the validation rule, you can’t save changes to a record that uses the field.
Considerations for AI Prediction Number Fields
These limitations are specific to AI prediction number fields:
- The number of decimal places and the character length of the number field must match the settings in Einstein Prediction Builder. Einstein Prediction Builder handles these settings for you when it creates the field. If you create the field, ensure that the number and length match the prediction in Einstein Prediction Builder. If the field being predicted is a Boolean field type, the number of decimal places defaults to 0 and the character length defaults to 3.
- To create and grant permissions to the field, the Manage Profiles and Permission Sets permission is required. Typically, this permission is set as part of the Customize App permission, but large orgs sometimes keep Manage Profiles and Permission Sets separate.
- You can’t disable the field setting. If you have to replace it, delete it and create another field.
- You can’t delete a prediction field if Einstein Prediction Builder is still referencing it.
- You can’t convert number fields enabled as AI prediction fields to other field types.
- The custom field setting, as well as the prediction results (scores) from Einstein Prediction Builder, are available in Salesforce Classic. The Einstein Prediction Builder setup flow is available only in Lightning Experience.