Velocity script issue: if - else | Community
Skip to main content
Christin_Scholz
Level 2
Jan 15, 2020 10:17 AM UTC
Solved

Velocity script issue: if - else

Hi all,

I have a question regarding velocity script.

We want to say the following:

If field "lead.bestOffer" contains "A" -> write "B" to the my.token "my.bank_name"

In all other cases, use the value that {lead.bestOffer} shows.

We tried the following way, but it didn't work:

#if(${lead.bestOffer} == "A")

#set($bank_name = "B")

#else

##otherwise, use the lead value

#set($bank_name = ${lead.bestOffer})

${bank_name}

Can anybody help?

Best

Christin

This post is no longer active and is closed to new replies. Need help? Start a new post to ask your question.
Jay_Jiang
Jay_JiangAccepted solution
Level 10
Jan 15, 2020 10:22 AM UTC

don't forget #end to close out the #if

2 replies

Christin_Scholz
Level 2
Jan 15, 2020 10:43 AM UTC

Awesome, that works! Thank you very much!

Translate
Jay_Jiang
Jay_JiangAccepted solution
Level 10
Jan 15, 2020 10:22 AM UTC

don't forget #end to close out the #if

Translate