How to add a pie chart in Campaign’s record page in Salesforce


Posted on Aug 30, 2020


featured image

What about if we add a component with a pie chart on the Campaign object’s record page? It’s very useful to see how the campaign is going in terms of leads’ statuses. So we want to know the percentage of leads converted, not converted, contacted, etc.

I will use Lightning in a Developer org that I just created to take advantage of its default data. So let’s go!

Assumption

You are familiar with a Salesforce org, Lightning and you have created some reports in the past. If you haven’t created any report yet, you can read this module in Trailhead: Reports & Dashboards for Lightning Experience

Add leads to a campaign

First of all, let’s add some leads to a campaign. You only have to add leads to a campaign, you don’t have to create any data.

Create the report

Go to Reports, New Report, expand Campaigns, select Campaign with leads and click on Create.

Drag Lead status field and group by this field

image

Save the report with the name you want and, importantly, in a public folder.

Run the report and add a pie chart. Don’t forget to save it.

image

Add the report component

Now let’s add our report to the Campaign’s record page.

Open any campaign and Edit Page to open the App Builder.

image

Drag the Report Chart component and set those parameters

image

Save the page and press Back to see the record page again with the report

image
salesforce reports lightning charts dev
Search
Side Widget
You can put anything you want inside of these side widgets. They are easy to use, and feature the new Bootstrap 4 card containers!