We have a webhook that returns recomendations (1-3 for example) for each user when triggered.
Looks like i must create custom fields for each lead, where response will be stored.
How can I make dynanic block with different amount of cards based on webhook's response?
How to make this block more independent (like snippet) to use in different emails?
Solved! Go to Solution.
Webhooks always map back to lead fields (in this case, one single field). Not to snippets. Velocity is far more powerful than any snippet.
You can clear the field with a Change Data Value if you want, but you might as well leave it until it gets changed again by the next webhook call.
Map stringified JSON back to a single Textarea field.
Parse that JSON back to a complex object in Velocity.
^ This is the best way. Found the strategy on the Teknkl blog and now have 10-15 JSON fields.
https://blog.teknkl.com/marketo-json-fields-in-velocity/
The only thing I would add is Marketo webhooks can be pretty slow if you need to backfill or update a lot of records. You prob. don't need to worry about this unless you have a large system, but might be worth monitoring. If you have bulk data needs, the API might be another option.
Same JSON / Velocity approach in both setups.
Got an update to that post coming, thanks for the reminder.
Thanks for reply.
But is there way to do it without Velocity only with Marketo GUI?
Can i get webhook response directly in some snippet without storing it in Lead's fields?
And if not how can i clear this fields after email was sent?
Webhooks always map back to lead fields (in this case, one single field). Not to snippets. Velocity is far more powerful than any snippet.
You can clear the field with a Change Data Value if you want, but you might as well leave it until it gets changed again by the next webhook call.