Loading
Nonprofit Success Pack (NPSP) Managed Package
Adding Badges to Contact Records

Adding Badges to Contact Records

Having badges auto-generated by a formula ensures data quality.

thank_you
thank_you Special thanks to the team at Patron Technology as well as Francis Pindar and Greg Malpass for their help and contributions with this article.

Nonprofits often request a “Type" picklist that includes values like “Donor” and “Volunteer." The trouble with that approach is that the list never gets updated after the initial setup - no-one remembers to go back and update the picklist if a Contact's status changes. Generally, it is better to have these values generated by a formula so that they can update automatically and even better to have the formula display an image, or a “badge” that indicates someone’s status at-a-glance.

Creating the fields on the Contact Record

See some examples of creating fields on the Contact Record.

Here are some examples of Contact donor badges we created at Seattle Theatre Group:

Example Badge
Example Badge

And here’s the formula that allocates a badge to a Contact, based on their giving levels (using the "Total Gifts" field from the Nonprofit Success Pack ):

Formula Example

So for anyone where the value of Total Gifts is greater than 0 and less than $2500, the Donor badge will be displayed. For anyone who has given more than $2,499, the Major Donor badge will be displayed. And for non-donors, the field will be left blank.

If you’ve tried a formula like this before, I’m sure you’ll see how you could add a date range to limit to more recent gifts as well.

We also have a badge for our subscribers (some people have two badges because they both donate and subscribe):

Subscriber

Subscription records are in a custom object that rolls up to Contact, so we have a “Most Recent Subscription” field just like with gifts, and that drives the formula here:

Subscriber Badge

You could easily adapt this technique for volunteers (Total Volunteer Hours greater than 0) or for memberships (using a count of membership records or the most recent membership start date) or really any kind of related record that you can summarize on the Contact record.

Add Your Images as Static Resources

The most time-consuming part of setting up these badges for me was creating the graphics! I used Google Drawings, but a marketing colleague could probably whip them up for you in a few minutes.

My badges are around 35 pixels high and between 115 and 150 wide depending on the label, and they are saved as .PNG files so they are very compact (around 5KB each). There are two ways to include images in your formulas in NPSP. I used to upload them as Documents, but now I add them as Static Resources instead. (The formula reference is simpler and the images will still be available to you in a sandbox.)

Search for Static Resources (under Setup → Build → Develop) and click on [New].

You need to give your badge a name with no spaces (like a Field Name). Choose your graphics file and set the Cache Control to “Public”. Click [Save].

Then click on the View file link. The badge will open in a new window. Select the URL from "/resource" onwards and copy it - you will need this for your formula.

Here’s the syntax for the formula again - note that you need to add IMAGE (“ before your reference and “, “title”) after it.

image resource

If you’d rather use the Documents folder for your badge graphics (it works too!), start by creating a new Documents folder for your badges and then upload them as Externally Available Images.

donor badge

This time you just need the Salesforce ID for the document. Copy the URL reference after ".com/"

url

and then your syntax formula looks like this:

formula2
forumla last
 
Cargando
Salesforce Help | Article