Skip to main content
Peter_Liske4
Level 2
April 7, 2018
Question

Reference Lead.Id in Velocity

In the list of fields on the right side of the velocity script editor, it appears the Lead ID field is missing, so I cannot check it.

So a reference to ${Lead.Id} in  velocity never has a value.  Perhaps I am missing something.


Is there any way to do this, other than copying the Lead.id field to a custom field and then using that?

Thanks

.

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

5 replies

SanfordWhiteman
Level 10
April 7, 2018

It's LeadID in the tree and $lead.leadID in VTL.

Translate
Peter_Liske4
Level 2
April 7, 2018

Sanford...thanks for confirming the name in VTL;  but in my instance, neither "Person ID" nor "Lead ID" show up in the tree of the Velocity script editor, and so I am unable to ever get a value for ${lead.leadID}.

I am curious if others have been able to successfully reference the Marketo Lead ID in Velocity?

Translate
SanfordWhiteman
Level 10
April 7, 2018

I knew I had just rolled out some very complex VTL that involved the $lead.leadID and that worked (and still does) but other instances I spot-checked didn't have it. Maybe this is a regression.

In any case you can get the ID, which is always in the context regardless, with

#set( $lead.Id = $convert.toInteger($mktmail.id.replaceAll("-.*${esc.d}","")) )

Translate