Skip to main content
May 3, 2017
Question

Getting JSON into marketo

  • May 3, 2017
  • 1 reply
  • 4513 views

Hi there, looking for some help. Hopefully the below makes sense from a non-technical marketer..

Goal: Have the ability to token data into a marketo email that has been passed from a JSON file on form submission.

Situation: On a non-marketo form submission we will have a web API that will be passing form data into marketo, however along with normal field data, the form submission includes a JSON file that has more complex data - two levels.

Question - it is possible for Marketo to unpack a JSON file with nested data into marketo fields? Or does it need to be passed to a CRM to do this/sync back a simple single level data back to Marketo. Or is there an alternative method altogether?

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

1 reply

SanfordWhiteman
Level 10
May 3, 2017

You should move the Q to Products​ as it's firmly product-specific ("Central" is supposed to be for general marketing topics.)

If you simply want to output JSON stringified data, then you can absolutely do this using a Velocity script. You don't have to parse the string into multiple fields. I've written extensively about Velocity techniques like this on my blog: see the tagged posts @ blog.teknkl.com/tag/velocity.

May 3, 2017

Thanks Sanford, have moved this to the Products section. So just to clarify would the JSON file (that has been created from a form submission) need to go into Marketo? Or would this data get extracted from the JSON via velocity scripting outside of Marketo.

I dont really understand that process - ie JSON file that exists outside of Marketo, and how that data would get into Marketo?


Cheers,

Josh

SanfordWhiteman
Level 10
May 3, 2017

Thanks Sanford, have moved this to the Products section. So just to clarify would the JSON file (that has been created from a form submission) need to go into Marketo? Or would this data get extracted from the JSON via velocity scripting outside of Marketo.

Well, when you refer to it as a JSON file, that's very different from a JSON field.

See, a Marketo textarea field can happily hold JSON strings (they're just strings, so there's no reason for any problem). Then other technologies (Velocity, JavaScript) can read those strings. So if you can write JSON to a field, you're all set (that writing could happen via either form post or API call).

But if you mean your JSON is in a separate file, like a standalone filename.json file saved on a remote webserver, you have to do something to bring that onto a lead. A webhook can pull the remote file onto a lead, to be sure: that's about the easiest possible kind of webhook, a 'hook that fetches a JSON file on a remote box and then spreads the results back into Marketo fields.  But Velocity can't read the remote file directly: Velo can only read the contents once they've been put into lead fields. And you also can't run a webhook against a lead that doesn't exist yet (i.e. webhooks are fundamentally for enriching lead data, but the lead has to be in Marketo first, even if all its fields are empty).

Perhaps you should explain in more detail what happens when a form is submitted to your external system. Does the data just sit in the external database? It is truly stored as JSON in the db, or is it stored as rows + columns?