SOLVED

Help with Velocity Scripting

Go to solution
ckowalczyk
Level 2

Hi,

 

I've been trying to build out one Velocity Script Token that has a fairly simple equation:


License_Group.Total_Called_in_last_30_days - License_Group.Number_of_Paid_Licenses - License_Group.Number_of_Unpaid_Licenses

 

Here are the screenshots of how it looks when it's in script:

 

ckowalczyk_0-1721846042492.png

 

ckowalczyk_1-1721846059503.png

ckowalczyk_2-1721846073135.png

 

But when I reference the token in the email, it seems to always come out like this and will not populate when using a test record I know should populate it:

ckowalczyk_3-1721846119777.png

Any help appreciated!

Thanks,

Chris

 

1 ACCEPTED SOLUTION
SanfordWhiteman
Level 10 - Community Moderator

None of those. You only work with $License_Group__c inside the loop, otherwise it does not exist in the Velocity context and will be null.

 

So closest to the 3rd one, but any reference to $License_Group__c inside the #foreach.

 

(Honestly not even sure where you’d get the idea $License_Group__c could be used. That’s not a variable Marketo declares for you. Only the list is declared.)

View solution in original post

12 REPLIES 12