Email Script Tokens. Can they access the db? | Community
Skip to main content
December 16, 2016
Solved

Email Script Tokens. Can they access the db?

  • December 16, 2016
  • 2 replies
  • 2434 views

So I'm looking for a way of getting a program running where the lead that is passed through the flow can influence or at least read data from other related leads. My first thoughts went to Email Script Tokens. Are we about to query some object to get back other leads in velocity?

I read this in stack overflow:

“Velocity is a very lightweight templating engine, it has very little functionality by itself. It works by interpolating variables defined (by you) in a context into a template file. By default, the context is empty, meaning that there are no variables for the template to use. Velocity doesn't allow instantiating new objects of custom classes, all it allows you to use is string and number literals, plus maps and lists. You're responsible for making Velocity "smart" by populating the context with useful objects before interpolating. As a starting point, you can use some of the Velocity Tools. You can add your own tools, like an SQL tool that lets you run queries.” – http://stackoverflow.com/questions/14374811/defining-database-queries-inside-velocity-templates

So it'll be down to whether Marketo has set up such tools. Do we have access to db queries or is it limited to just the Standard and custom objects we see on the right?

:-)

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Best answer by SanfordWhiteman

Marketo's Velocity implementation has absolutely no database nor general network or file access.

2 replies

SanfordWhiteman
New Participant
December 16, 2016

If you want to access an API (any API, not just Marketo's) from a flow you can use a webhook.

Be careful accessing any metered service (viz. Marketo's API limitations) in this way, as non-batched queries can quickly overwhelm limits.

December 16, 2016

Thanks @Sanford Whiteman​ for the quick replay :-)

Yeah, was seeing if there was a quick route that would preserve our api quota! Or least reduce the dev work.

SanfordWhiteman
New Participant
December 16, 2016

You can push (not so much pull) data from lead to by using a webhook to fire a form post. Takes engineering to make this a solid solution, though.

Similarly, you can use webhooks to send data to external sources and then fetch the data using other 'hooks. Again, not simple, but you can build valuable tools this way.

SanfordWhiteman
SanfordWhitemanAccepted solution
New Participant
December 16, 2016

Marketo's Velocity implementation has absolutely no database nor general network or file access.