We have a JSON source of data with information on 150 locations. Based on a field ID in a person we would like to load the data for 1 of those locations into an email (Address etc).
We see two possible options but are seeing issues both routes:
Solved! Go to Solution.
You can't do this with a Custom Object -- there's no such thing as a shared CO (2nd-level CO) that's accessible from Velocity. So [1] is just not an option. (Which is fine, [2] is a good approach.)
(Do I have JSON Path or would it have to be nested array structure). and if the JSON structure were to change I would have to update every single email template (Instead of 1 piece of code for import).
You don't have JSONPath, so you'd be iterating over a List or Map (of course any userland JSONPath implementation is actually doing the same thing).
I don't see why that would even be necessary, if the keys of a Map are your field IDs you can just seek right to them.
You also don't need to update any templates if your matching criteria change, just change the Velocity token that does the seeking. One change in one place.
You can't do this with a Custom Object -- there's no such thing as a shared CO (2nd-level CO) that's accessible from Velocity. So [1] is just not an option. (Which is fine, [2] is a good approach.)
(Do I have JSON Path or would it have to be nested array structure). and if the JSON structure were to change I would have to update every single email template (Instead of 1 piece of code for import).
You don't have JSONPath, so you'd be iterating over a List or Map (of course any userland JSONPath implementation is actually doing the same thing).
I don't see why that would even be necessary, if the keys of a Map are your field IDs you can just seek right to them.
You also don't need to update any templates if your matching criteria change, just change the Velocity token that does the seeking. One change in one place.
I am trying to import the data with the API, It looks like i can't import a Script token with the API, Can I import a text token with API and then use that in my email script as the "data source"?
You certainly can modify a script token via API. I do it all the time. What endpoint were you trying and what payload?
oh that would be amazing if we can do that. I was referencing the documentation here: http://developers.marketo.com/rest-api/assets/tokens/ and I don't see script token mentioned. Do you know of any documentation on modifying script tokens?
Set
type=script block
It otherwise is the same as other types.
Thanks Sanford, you have been very helpful!
Hi,
as you have mentioned to use "type=script block" to update Script-tokens via API - this seems not working anymore since the last 4 weeks - and a Marketo technical guy confirmed they have blocked this type to use on a post,
as its was never documented as an option to use - but it was working well for many month.
Now we have a problem, do you see any other option now on how to update a Script-token via API?
We tried to update/write the html in a "rich-text" token {my.content_25112} - and just add this token in a script token - like below,
but the content doesn´t get displayed in an email.
script-token:
#### CONTAINER 1 #####
#set ($slotid_25112 =
${my.content_25112}
Any recommendation from your experiance?
thanks
Hans-Martin
Hello,
I can confirm 'script block' is not updating anymore through the API. Is there any other work around you have found so far?
It looks like a text token can't be done that way either. Is there any way to import this data with the API to a location that can be used by an email script? Data changes almost daily so I really don't want to copy/ paste...