Start tracking your progress
Trailhead Home
Trailhead Home

Get Started with Einstein Prediction Builder

Learning Objectives

After completing this unit, you’ll be able to:
  • Explain what Einstein Prediction Builder can do.
  • Explain what formula fields are.


With the winter holidays around the corner, people all over are decorating and lighting up their homes to host friends and relatives and celebrate the season. You’re just as excited about the holidays, but as the operations manager of the mid-sized electricity company Lightning Energy, you’ve also got other things on your mind.

Lightning Energy has customers across the country, and you need to prepare for the spike in your customers’ electricity bills for the month. The problem is that with the New Year’s festivities, food, and fun, people sometimes forget to pay their electricity bills on time. In fact, every year you notice an increase in late payments during major holidays and travel seasons. Of course, everyone is human, and even you make a late payment here and there.

Last year at this time, you asked staff to send out emails to customers about their upcoming payments. It was a mass effort, but the emails did little to improve the situation. Most customers didn’t respond. As a growing business, it just isn’t practical to have your already-overburdened employees reach out to each customer to remind them to pay their bills. The odds seem to be stacked against you, but you’re determined to find a way to minimize the late invoice payments this year.

Make Predictions with Einstein

As a newer user of Salesforce, you’ve recently heard about Einstein, the AI platform. Einstein Prediction Builder lets you make predictions about almost any field in Salesforce with just a few clicks. Then, you can use the predictions to power a workflow, focus your efforts, and work smarter. No models, no algorithms, no code needed. Point. Click. Predict.

Check it out in this short video.

Einstein Prediction Builder works best with yes or no questions and predicting numerical data. If you frame questions with that in mind, Einstein Prediction Builder can tell you whether a customer is likely to make a late electricity bill payment. It can even predict how many days late a customer might be. That information can go a long way in helping you solve Lightning Energy’s late invoice payments problem. Once you know which customers are likely to pay late, you can focus your efforts on reaching out to them or even set up automatic reminders.

Want to Get Hands-on with Einstein Prediction Builder?

In this module, we show you the basic steps to set up a late payment prediction in Einstein Prediction Builder. We don’t have any hands-on challenges in this module, but if you want to practice and try out the steps, you need a special Developer Edition org that contains Einstein Prediction Builder and our sample data. A regular Trailhead Playground doesn’t have Einstein Prediction Builder or our sample data. Likewise, an older Developer Edition org with Einstein Prediction Builder doesn’t have our sample data. Here’s how to get the free Developer Edition now.

  1. Sign up for a free Developer Edition org with Einstein Prediction Builder.
  2. Fill out the form. For Email, enter an active email address. For Username, enter a username that looks like an email address and is unique, but it doesn't need to be a valid email account (for example,
  3. After you fill out the form, click Sign me up. A confirmation message appears.
  4. When you receive the activation email (this might take a few minutes), open it and click Verify Account.
  5. Complete your registration by setting your password and challenge question. Tip: Write down your username, password, and login URL for easy access later.
  6. You are logged in to your Developer Edition.

Create a Formula Field

Before you start building a prediction, you need to take a quick look at the data. To do that, from the App Launcher, find and select Invoices, then change the list view to All. You see all of Lightning Energy’s invoice records.

Einstein builds predictions on historical data. That means you always make sure there’s a fairly large dataset so the prediction isn’t skewed. Because of this, Einstein requires a minimum of 400 rows for the predictions. For a binary prediction, we recommend a minimum of 100 rows for each outcome. We go into troubleshooting the prediction results later, but it’s always a good idea to check the data before you add any additional fields.

Since you want to predict the likelihood of each customer making a late payment, you need to create a formula field for late payments. From the Object Manager, you can see:

  • Invoice, a custom object. Each Invoice record represents a customer’s invoice at Lightning Energy.
  • Invoice Status, a picklist field on the Invoice object with options that include:
    • Paid on Time
    • Pending
    • Late

Einstein Prediction Builder supports numeric and checkbox data types, as well as formula text fields that return TRUE, FALSE, or NULL. You want to ask the yes or no question: Will the invoice be late? In Einstein, this translates to: Status = Late. Let’s create a custom formula field for Late Invoice Payments.

  1. From Setup, click Object Manager.
  2. Search for and select Invoice.
  3. Click Fields & Relationships.
  4. Click New.
  5. Select the Formula data type, then click Next.
    Select Formula data type
  6. For the Field Label, enter Late Payment and select Checkbox for the return type. Then click Next.
    Select Checkbox return type
  7. Enter the formula ISPICKVAL(Invoice_Status__c,"Late") in the Late Payment (Checkbox) field on the Simple Formula tab, and click Next. The above formula returns a True value if the invoice payment was late, and a False value if not.
    Enter the formula for the custom field
  8. Leave the default options for field-level security on the following page, clicking Next, then Save.

You've just created a formula field that will help us predict the likelihood of a customer making a late invoice payment to Lightning Energy. Neat!

Einstein Prediction Builder can build strong predictions with your data, but you can also enrich the prediction by creating other special fields. For example, you can create a Previous Late Invoices field that shows Lightning Energy customers with past late invoice payments. The Previous Late Invoices field can help the model better predict future late invoice payments.



If you're following along in a Developer Edition org with Einstein Prediction Builder and our sample data, we have already included the Previous Late Invoices field for you.

Build a Report on Your Prediction

Before tapping into Einstein’s AI power, we recommend that you build and run a report on the new field to make sure everything is accurate. Reports also show data volume. Here’s how to build a report to view the late payments on your invoice records at Lightning Energy.

  1. Click App Launcher and select Reports.
  2. Click New Report.
  3. Search for and select Invoices, then click Continue.
  4. Under Group Rows, search for and select Late Payment.
  5. At the bottom of the page, uncheck Detail Rows, then click Run.
    Report showing late payments

The report shows all invoice records grouped by True or False in the Late Payment field. Running this report helps you catch and fix inaccurate formula fields since they are usually easy to spot. We recommend running this report with each new step you take in preparing Einstein Prediction Builder to confirm everything looks good.



Rights of ALBERT EINSTEIN are used with permission of The Hebrew University of Jerusalem. Represented exclusively by Greenlight.