Use a Screen Flow to Enrich Records with Predictions

Create a screen flow to get records from Salesforce objects and add a prediction to a Lightning page. For example, you can add a lead conversion prediction score to a lead record.

Required Editions

Available in: All Editions supported by Data 360. See Data 360 edition availability.
USER PERMISSIONS NEEDED
Allow users to manage models in AI Models Enables you to create, update, and delete models in AI Models.
PERMISSION SETS
Data Cloud Architect Admin-level access to all AI Models features, including the ability to create, update, delete, and activate models.
Data Cloud User Restricted access to use a model, including getting predictions and improvements derived from a model.

Before you create a flow, ensure that your predictive model is activated in AI Models (formerly Einstein Studio).

  1. From Setup, in the Quick Find box, enter Flows, and then select it.
  2. Create a flow from scratch. Flow Builder launches.
  3. Create a screen flow.
    Salesforce Flow screen displaying the screen flow option.
  4. To get the inputs required to run the model, add the Get Records element.
    A screen flow displaying the Get Records element.
    For example, to get leads records.
  5. For the data source, add a Salesforce or Data 360 object. Enter a label, API name.
    In this case, select the Lead object.
  6. (Optional) Filter records based on a condition, field, operator, and value.
    Screen flow displaying options for filtering records.
    For example, to predict leads by record ID, filter your data by selecting All Conditions Are Met (AND), Field=Id, Operator=Equals, and Value=Resource (a variable named recordid).
  7. To use data that resides elsewhere, add another Get Records element, and enter the information.
  8. Add the Action element, and choose the predictive model that you want to use.
    A screen flow displaying various predictions as actions.
    For example, "Predicted Lead Conversion."You can search for your model by its name or location in the Data Cloud action category.
  9. Because your model needs inputs to generate predictions, map the relevant fields.
    A screen flow action displaying input values for a lead conversion prediction.
    For example, use the fields from the lead object that match your model inputs.
  10. After you configure an action, a resource {ActionName.Prediction} is available to use in the flow.
  11. To append a prediction score to your record page, add a screen interaction to the flow, and enter a label, API name, and resource.
    For example, {!Predicted_Lead_Conversion_Action_1.Prediction}.
  12. Save the flow.
  13. Test the flow, and then activate it.
  14. To view leads in your org, go to the App Launcher and enter Marketing CRM Classic.
  15. Add the screen flow to a record page to show prediction scores on all leads records.
    A flow component to add your predictions to a record.
    1. Go to Setup, and edit the object in Object Manager.
    2. Use the Lightning Record pages to create a record page.
    3. On the Components tab, search for Flow, and drag the component to your preferred location on the object.
    4. Add the flow that you want to use on your object, and save to display the output from your flow.