Velocity and Custom Objects - Extreme Basics of Syntax/Use Cases
I apologize for all the Velocity posts, but I'm bashing my head against the wall, so I want to get super basic here and explain the issues I am having and make sure I understand the syntax properly.
Here is a junk data image of one of our objects:
CO_example.PNG
We tend to have multiple of these "Customer Profiles" underneath one email - so one "Lead" might actually hold the info for multiple individuals. This starts my rounds of very basic barebones questions:
1) For Custom Objects, to use the #foreach action, is this the correct syntax?
Assuming $individualEmailIdentifier is the field itself and customerProfiles is the object name?
#foreach ($individualEmailIdentifier in $customerProfilesList)
2) If I wanted to output ALL the values in the entire Customer Profile for "Age", would the syntax for the output be:
$customerProfilesList.age
OR
$age
3) If I wanted to output ONLY values related to one profile in the array, how do I ensure that? I'm assuming I would need something more distinct like a ROW ID or other field? I get using a #foreach, but how do I pull only one set of values instead of all?
4) In the case of the below, I get that the "get(0) pulls the 0th value in the Array, but I'm assuming it looks across the entire Customer Profile array regardless of which "profile" it is pulling from? It's pulling the most recent updated data for that particular field?
#if ( $customerProfilesList.get(0).membershipStatus.equals("Member") )
Lead is a Member
#else
Lead IS NOT a Member
#end
Basically, the issue across our data boils down to needing to pull multiple values from a specific row and I'm currently not able to effectively do that.
I apologize for the long post and probably basic questions, but I haven't found a lot of basic data on how to get started with Velocity within the context of Custom Objects - or I am looking for the wrong things 🙂 Thank you!!