Can I access custom object data via a token? Could not find any info in the docs and got an error in my smart campaigns.
The custom object is tied to the lead via id, how can I reference that lead's instance of the object?
Solved! Go to Solution.
You can't access COs as tokens in a simple Flow context, only in a Velocity context.
Well that's a bummer.
Thanks for the quick response.
What are you trying to do exactly?
Our event integration writes to the custom object directly, looking to set up smart campaign to write some of the values to fields on the lead too so it can sync to our CRM. I'm waiting to hear back if your integration allows us to write to the lead and custom object record at the same time, just testing fall back plans.
A two-phase commit (to CO and to lead field) might be a workaround.
But presumably you're using COs for the 1:N lead:object relationship, right? A single lead field can actually perform much the same function, if you store the objects as an append-only JSON array (every new object becomes a new array item). On the other hand, if you overwrite the corresponding lead fields each time, the CRM sync can be lossy.
Check my last answer here too.
Yeah. humm interesting. The integration is able to write to the CO and lead field at the same time so plan A is good to go.
I am curious about your approach though. How would I be able to parse that to do a data value change or is it all via webhook(FlowBoost)?
var jsonArray = {{lead.JSON array}},
lastEvent = jsonArray[jsonArray.length - 1];
return lastEvent["eventID"];
Sorry, never used webhooks. How does that return statement change the value of a field for that lead, say {{lead.Event ID}}?
I'd say it all depends on how/where (and how easily) you want to write, read, action, and report on the data.
Marketo Flow steps (on their own) can assemble JSON arrays of objects, given a single object as input, say, from a form post. You need three steps/fields:
Certainly it's easier to use FlowBoost because it's JSON-fluent (you wouldn't need the intermediate list). But it's possible to write an append-only JSON field without FB.
In your example, you're reading a single property ("eventID") off the last event in the array. That would result in a webhook response like this:
{
"response" : 12345
}
I don't know exactly what you want to do with the response, though. You don't have to map it back to a lead field, since you can use the Webhook is Called trigger to take action on the contents of the response without actually saving the contents. This is an efficient way to avoid creating extra fields.
That is awesome! I am going to play around with this in sandbox, thanks for taking the time to explain. Very much appreciated!
Can you access tokens in the email editor setting? I'm trying to use a few fields form the custom object in an email alert. object is "RV Member". I would think token looks like {{RV Member.Phone}}, but I can't find the token within the email editor. (When you go to insert token, and search the dropbox.) Would I just type that into the email?