AnsweredAssumed Answered

Velocity Script if/else Statement

Question asked by 2a46e3af07f50f038780d3d1a2824d043c418147 Champion on Nov 21, 2016
Latest reply on Nov 21, 2016 by 2a46e3af07f50f038780d3d1a2824d043c418147

I'm trying to write a Velocity Script statement that looks at our account numbers to see if it's blank. If the account number is blank, I want it to write the Company Name instead. If the Account Number is not blank, I want it to write the Account Number. This is my first time using Velocity Script, so I'm probably doing it wrong.

 

Here's what I have based on scouring Community. When I send the test email as someone with an Account Number, I get "${my.vSCRIPT_2}" where my Account Number should be.

#if(${lead.Oracle_Account_Number__c} == "")

${lead.Company}

#else

${lead.Oracle_Account_Number__c}

#end

I'm happy to do if differently if there's a better way!

Outcomes