SOLVED

Email Script Tokens. Can they access the db?

Go to solution
Highlighted
Anonymous
Not applicable

Email Script Tokens. Can they access the db?

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?

🙂

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Level 10 - Community Moderator

Re: Email Script Tokens. Can they access the db?

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

View solution in original post

5 REPLIES 5
Highlighted
Level 10 - Community Moderator

Re: Email Script Tokens. Can they access the db?

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

View solution in original post

Highlighted
Level 10 - Community Moderator

Re: Email Script Tokens. Can they access the db?

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.

Highlighted
Anonymous
Not applicable

Re: Email Script Tokens. Can they access the db?

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.

Highlighted
Level 10 - Community Moderator

Re: Email Script Tokens. Can they access the db?

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.

Highlighted
Anonymous
Not applicable

Re: Email Script Tokens. Can they access the db?

Webhook worked a treat. The Flow for lead 1 triggers a webhook sending the known id of lead 2. The external source fetches some fields and sends them back in the response. The response maps the required data to fields on lead 2 and triggers the next set of actions. Nice!

🙂