Adding multiple Score fields using FlowBoost, with some extra tricks

I don’t post nearly enough about FlowBoost. Don’t know if it’s humility or stupidity, but you’d think The Greatest Marketo Add-On Ever™ would be promoted a little bit more, no?

The very first need I had for something like FlowBoost, back in 2016 (!!!), was to add up Score (or Integer) fields.

And to this day, there’s no way to do this without FlowBoost or a custom-built service that does the same thing. But why not do it with FlowBoost, since it’s free (up to 100,000 calls per month) and time-tested?

Here’s the simplest FlowBoost webhook payload to add up a few scores:

personScore = +{{lead.Behavior Score}} + 
    +{{lead.Demographic Score}} +
    +{{lead.Firmographic Score}};
Simple score addition

Then map personScore in the Response Mappings.

What if you want to make sure the final score never goes above 100 or below 0? Easy with JavaScript’s built-in Math methods:

personScore = +{{lead.Behavior Score}} + 
    +{{lead.Demographic Score}} +
    +{{lead.Firmographic Score}};
personScore = Math.max(0,personScore); 
personScore = Math.min(100,personScore);
Score addition with min/max

Finally for today, what about using a percentage increase for a score instead of a fixed increment? Just multiply and round to the nearest whole number:

behavioralScore = (+{{Lead.Behavioral Score}} * 1.2).toFixed(0);
Incrementing a score by percentage

For example, that’ll take the score from 90 → 108 → 130 → 156: the more activity, the bigger the bumps.

Couple of notes

  • The extra + signs before the tokens (as in +{{Lead.A Score Field ) are to make sure empty, untouched scores (which are, confusingly, sent by Marketo as empty strings) get converted to number 0.
  • I decided to leave out the var keyword (i.e.  personScore = ... instead of var personScore = ...) because you need a property of the global object, and that happens automatically if you omit var. Keeps the request payload a little shorter.