6 Replies Latest reply on Jan 4, 2018 4:31 PM by Liz Davalos

    I Broke My Adapted Velocity Scripts

    Liz Davalos

      First I'll say I've already received significant help from many people here on getting my toes wet in velocity scripting. Here's some I adapted for my purposes (that other's shared) and I somehow broke:

       

      The point of this is to only show the token data if they have a city in the system:

       

      #if( !$lead.City.isEmpty() && !$lead.Inferred_City.isEmpty() )
         #set ($nearlocation = "")
      #elseif ( !$lead.City.isEmpty() )
      #set ($nearlocation = " Near ${lead.Inferred_City}")
      #else
      #set ($nearlocation = " Near ${lead.City}")
      #end
      ${nearlocation}
      

      This token is for a sentence that either ends with their first name (if we have it) or just ends.

       

      #if (!$lead.FirstName.isEmpty())
        #set ($greeting = "")
      #else
        #set ($greeting = " ${lead.FirstName}")
      #end
      ${greeting}
      

      Thank you, thank you, thank you, to anyone who can help me solve this, ETA 10ish days total now working with Velocity Scripts.