The reason is because I am using a custom object as generic event, therefore there are many different types of attributes some which are different depending on the event type. The other option we were thinking was do a field with a delimiter of key and values. So the field would be:
Name - Attributes:
Value - DocumentUrl:http://www.test.com;DocumentName:TestDocument
1 of 1 people found this helpful
I've seen similar things done just by using a text field, and then picking a delimiter and mapping each possible field to a particular array index. So for example, you have these fields in your virtual object:
You would then serialize it with your selected delimiter like so:
As long as you're serializing uniformly and always have the same indexes for fields, then you can get this:
#set($objectFieldArray = $myObjectList.get(0).split("|"))
#set($firstName = $objectFieldArray)
#set($lastName = $objectFieldArray)
#set($company = $objectFieldArray)
This will work for any type of flat record, but can be troublesome for objects with additional depth.
Thank you! In addition it would be nice if Marketo implemented a velocity plugin for serializing JSON such as https://github.com/lindenb/jsvelocity This would allow us to make events very generic and support a range of customization with minimal effort on marketo front. Imagine if we could access json + custom activities could be available in email scripting. We could do some amazing stuff
Kenny Elkington Since Velocity seems to support XML, have you seen people do this with XML instead of JSON. In addition do you happen to know when Marketo references
You can reference first and second level custom objects that are directly connected to the Lead or Contact, but not third-level custom objects.
Does this mean if a Lead has many Opportunities, and those opportunities have many Proposals... is Lead considered top level, and opportunities 2nd level? Would proposals be 3rd level?
Also what is the max length by default on a string on a custom obejct? Is this changeable by support?
I have not seen anyone use XML for this with velocity, but we do not enable the XML tool in Marketo, so I think it would be a similarly tough scenario to JSON.
>Does this mean if a Lead has many Opportunities, and those opportunities have many Proposals... is Lead considered top level, and opportunities 2nd level? Would proposals be 3rd level?
You can't link to custom objects through opportunities in Marketo, so this isn't applicable here.
>Also what is the max length by default on a string on a custom obejct? Is this changeable by support?
Strings are 255, Text is 2000, and Text Area is 30000, none of the lengths are alterable.