---
schema_version: "1"
id: 79e4be8f5edc230ac442277a79b579476b07ffddd28b84b1acc3434ed0bdad88
title: Get Predictions in Process Automation Formulas
collection: admin
version: current
locale: en-us
portal_url: https://docs.salesforce.com/admin/current/en-us/analytics/264-0-0/bi_edd_prediction_process_automation_formula.md
canonical_url: https://help.salesforce.com/s/articleView?id=analytics.bi_edd_prediction_process_automation_formula.htm&release=264.0.0&type=5
source_site: help.salesforce.com
content_type: documentation
content_hash: cb77345866e3c2bb1ea8c520331c964f9dc7a020c175e471828145d076debdfc
description: 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.
products:
  - CRM Analytics
  - Cross Cloud
release: "264"
---
# 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](https://help.salesforce.com/s/articleView?id=platform.customize_formuladef.htm&type=5&language=en_US) and [PREDICT](https://help.salesforce.com/s/articleView?id=platform.customize_functions_predict.htm&type=5&language=en_US).

![Note](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/images/icon_note.png)

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](https://help.salesforce.com/s/articleView?id=analytics.bi_edd_setup_assign_permsets.htm&release=264.0.0&type=5 "After you have defined permission sets for Einstein Discovery users, you can assign the appropriate permission sets to individual users or groups of users. You can assign multiple permission sets to an individual user account.").

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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/bi/images/bi/bi_edd_prediction_process_automation_formula_new.png)
    
    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
    
     
    | Parameter | Description |
    | --- | --- |
    | 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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/bi/images/bi/bi_edd_prediction_process_automation_formula_select.png)
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](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/bi/images/bi/bi_edd_prediction_process_automation_formula_record.png)
5. Click **Save**.

![Example](https://sf-zdocs-cdn-prod.zoominsoftware.com/tdta-analytics-bi-264-0-0-production-enus/ec791473-f5b4-4f64-a656-9104f455d966/images/icon_example.png)

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.