Selecting a particular Custom object to display in Velocity Token for emails

LCENTENO
Level 3

Hi everyone, 
Quick question. I have a custom object called "Accounts", which has several different data fed fields including one called "Product". I created the custom tokens in my velocity script (snapshots below) to show the balance, and next date due of a specific product.


Payment Velocity Script:

LCENTENO_1-1682610442284.png

Next Due Date Velocity Script:

LCENTENO_2-1682611018262.png

Product Code Velocity Script:

LCENTENO_3-1682612187074.png

 

However, the data shown when the tokens are placed in the email is incorrect, as it is pulling the payment amount and due date info for the wrong product. The issue here is that under the "Accounts" custom object, another entry is added for every new product that is purchased by a customer. My question is, is there a string of code that should be applied to the "payment" and or "due date" custom tokens to ensure that the data pulled is for the correct Product? Thanks in advance. 🙂

Best,

Lucas

42 REPLIES 42
SanfordWhiteman
Level 10 - Community Moderator

{{lead.First Name:default=edit me}}, this is a reminder that your first loan payment of {{my.CurrentPayment:default=edit me}} is due on {{my.NextDueDate:default=edit me}}.

With Velocity tokens, you don’t use the :default= syntax. You choose the default output within your code and only put {{my.token}} in the email.