Dynamic Image from Marketo DB

Highlighted
Level 2

Dynamic Image from Marketo DB

I have a spreadsheet that will be manually loaded into Marketo with a reference to the contacts representative/company contact. They (the internal client) would like to feature the reps photo with the contact information.

I'm trying to figure out how to associate the reps image with their contact information without having to hard code the URL at the database level. I was thinking Velocity but have not found a good sample.

Sanford Whiteman​ I searched your blog and found some close references but could use your help.

Any help would be awesome!

Thanks,

Eric

2 REPLIES 2
Highlighted
Level 7

Re: Dynamic Image from Marketo DB

You can achieve this with a simple naming setup that makes use of existing tokens, e.g. FirstName LastName.jpg

So your url to the image file would be "path/{{lead.Sales Owner First Name}} {{lead.Sales Owner Last Name}}.jpg"

Highlighted
Level 10 - Community Moderator

Re: Dynamic Image from Marketo DB

Like Jay says, if you can name the images in a URL-safe and consistent fashion, then you don't need additional logic to figure out the URL as you can simply reuse the fields.

However, if you try to do it this way, I definitely wouldn't use the first/last names, but rather the owner's email address, for 3 reasons:

  1. Only a tiny fraction of the characters that are valid in those owner names are also valid unencoded in a URL, and the moment you have any exceptions the setup can't work (while the same is technically true of the "@" and "+" in emails, in reality those characters do not need to be encoded in files hosted on Marketo)
  2. Owner email addresses are relatively static, compared to first names and last names (even nicknames and name changes due to marriage/divorce usually keep the old email address around as an alias)
  3. Owner email addresses are unique, first and last names are not (when you work in large global orgs and set up your 5th account for an Ankur Sharma, this becomes top-of-mind!)

I still approach such projects with trepidation and bookmark them as relatively fragile, no matter what. Using Velocity allows you to properly percent-encode URLs, which a lot of people don't realize is even a thing.