Loading
CRM Analytics
Table of Contents
Select Filters

          No results
          No results
          Here are some search tips

          Check the spelling of your keywords.
          Use more general search terms.
          Select fewer filters to broaden your search.

          Search all of Salesforce Help
          Get Predictions in Process Automation Formulas

          Get Predictions in Process Automation Formulas

          Use the Einstein Discovery PREDICT function to get predictions in your process automation formulas. Your automation logic can make decisions based on predicted outcomes from deployed Einstein Discovery predictions. For example, in an approval process, a formula can determine whether a predicted outcome meets a threshold required for automatic approval.

          PREDICT Function in Process Automation Formulas

          The PREDICT function is available when defining formulas associated with:

          • Next Best Action
          • validation rules
          • screen, headless, and invocable flows
          • processes (in Process Builder)
          • workflow rules
          • approval processes
          • predefined field values
          • field update actions
          • default values

          To learn more, see Calculate Field Values With Formulas and PREDICT.

          Note
          Note The PREDICT function is not supported in formula-based fields on Salesforce objects.

          Permissions Required to View Predictions and Improvements

          To view predictions, users must have the View Einstein Discovery Recommendations permission assigned to their Salesforce account. To learn more, see Assign Einstein Discovery Permission Sets to Users.

          Use the PREDICT Function in a Formula

          1. Create or edit an approval process, flow, process (in Process Builder), workflow rule, or Next Best Action.
          2. In the formula builder, under Functions, select Advanced, select PREDICT, and click Insert Selected Function.
            The following example shows the default entry for PREDICT in a formula for an approval process.
            Formula builder showing the default PREDICT entry for an approval process

            The PREDICT function returns an Einstein Discovery prediction for a record based on the specified record ID or for a list of fields and their values. It uses the following syntax:

            PREDICT(PredDefId, [recordId] | [field, value, ...])

            where

            ParameterDescription
            PredDefId The Prediction Definition ID of a deployed prediction in your Salesforce org.
            [recordId] The recordId of the record for which you want a prediction. If specified, the PREDICT function returns a prediction for the data values in that record.
            [field, value, ...] List of field names and values. Be sure to provide all the fields that the prediction requires as input. If specified, the PREDICT function returns a prediction for the data values you provided.
          3. Define the prediction you want to use in this formula.
            The syntax for PredDefId must match the following pattern:
            $SmartDataDiscovery.PredictionDefinitions.<predictionDevName>.Id
            Select PredDefId, click Insert Field, select SmartDataDiscovery > Prediction Definitions, select an available prediction, select Prediction Definition Id, and click Insert.
            Inserting a prediction into the PREDICT function for an approval process
          4. Specify the record ID or provide a list of fields and associated values.

            The following example shows the formula for an approval process. It evaluates to TRUE if the predicted outcome for the given record is less than the specified discount amount (Discount__c).

            Formula builder showing the completed PREDICT formula for an approval process
          5. Click Save.
          Example
          Example

          Example Formula with recordId:

          PREDICT($SmartDataDiscovery.PredictionDefinitions.Recommende_kFjqS_1370.Id, Id)

          This example calls the PREDICT function and passes a prediction definition and recordId.

          Example Formula with List of Fields and Values:

          PREDICT($SmartDataDiscovery.PredictionDefinitions.Recommende_kFjqS_1370.Id, 
                    'Customer_Typec', Text(Customer_Typec), 'List_Price__c', List_Price__c)

          This example calls the PREDICT function and passes a prediction definition and list of fields with associated values.

           
          Loading
          Salesforce Help | Article