I am creating a form using the "select" field type with two options:
Do you have a relationship manager "Yes" "No"
When they submit I have set up an alert email to my inbox using a token to pull through
Select your relationship manager: {{lead.Select your relationship manager:default=None}}
Instead of pulling through "Yes" "No", yes is pulling through a 1 and no is pulling through a blank. Is there a way to adjust this?
Let me know thanks
Solved! Go to Solution.
Sanford Whiteman thanks for your help. Still not working for me though - do you think its because my field name contains spaces?
#set( $friendlyBoolean = {
"1" : "yes",
"" : "No"
} )
${friendlyBoolean[$lead.Do you have a relationship manager]}
You need a Velocity (Email Script) token to display different values. See my code here: https://nation.marketo.com/message/172040-re-form-submission-alert-creates-new-lead#comment-172040
Sanford Whiteman thanks for your help. Still not working for me though - do you think its because my field name contains spaces?
#set( $friendlyBoolean = {
"1" : "yes",
"" : "No"
} )
${friendlyBoolean[$lead.Do you have a relationship manager]}
When you click and drag your field onto the Script Editor from the tree on the right side, you'll see what its Velocity name is (spaces will be removed).
Awesome thanks so much - working as expected now! Do you know whether it's possible to add more that one my token. I have another "" "1" question pulling through.
Of course, you can add more tokens (or more lines of output from a single token).
If you need to do repeated comparisons it's shorter to use a macro:
#macro( b $mktoBooleanField )
#if( $mktoBooleanField.isEmpty() )false#{else}true#{end}
#end
#if ( $convert.toBoolean("#b($lead.myFirstBoolean)") )
myFirstBoolean was true
#end
#if ( $convert.toBoolean("#b($lead.mySecondBoolean)") )
mySecondBoolean was true
#end
#if ( $convert.toBoolean("#b($lead.myThirdBoolean)") )
myThirdBoolean was true
#end