Velocity scripting with segmentations | Community
Skip to main content
BenCirillo
Level 2
December 16, 2024
Solved

Velocity scripting with segmentations

  • December 16, 2024
  • 1 reply
  • 743 views

Has something changed or suddenly stopped working with Velocity reading segmentations? 

 

I have a simple script that creates a greeting line based on segmentations. Basically, if you're in one of our physician segments, it says "Dear Dr. (Lastname)", otherwise if your full name isn't blank it says "Dear (Full Name), otherwise it just says "Greetings." 

 

This script was working fine, now suddenly the segmentations aren't being recognized. The script still works because it's moving on to the next condition and displaying full names. But members in the segments aren't being recognized as such. I checked the records I was testing and they are marked as being in the segment. I also checked to make sure all the relevant fields, including segmentation, were checked in the script token. 

 

Here is the script: 

#if ($lead.Segmentation_MasterAudienceSegementation_1001 == "ASPS Active Members + Candidates" || $lead.Segmentation_MasterAudienceSegementation_1001 == "ASPS Intl Active + Candidates" || $lead.Segmentation_MasterAudienceSegementation_1001 == "RFF Domestic Residents and Fellows" || $lead.Segmentation_MasterAudienceSegementation_1001 == "RFF International Residents and Fellows" || $lead.Segmentation_MasterAudienceSegementation_1001 == "Other Physicians") Dear Dr. $lead.LastName, #elseif ($lead.Full_Name != "") Dear $lead.Full_Name, #else Greetings, #end

 

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

Never mind, I figured it out. I had changed the name of the segmentation to correct a typo (Segementation instead of Segmentation) and didn't update the name in the script. One of those easy to overlook typos that even after having made the change, staring at the script I didn't notice. 

1 reply

SanfordWhiteman
Level 10
December 16, 2024

What's the output of simply

${lead}

 

BenCirillo
BenCirilloAuthorAccepted solution
Level 2
December 16, 2024

Never mind, I figured it out. I had changed the name of the segmentation to correct a typo (Segementation instead of Segmentation) and didn't update the name in the script. One of those easy to overlook typos that even after having made the change, staring at the script I didn't notice.