SOLVED

Re: Alert email not reflecting form input

Go to solution
Simone_Toit
Level 2

Alert email not reflecting form input

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

1 ACCEPTED SOLUTION

Accepted Solutions
Simone_Toit
Level 2

Re: Alert email not reflecting form input

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]}

View solution in original post

5 REPLIES 5
SanfordWhiteman
Level 10 - Community Moderator

Re: Alert email not reflecting form input

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

Simone_Toit
Level 2

Re: Alert email not reflecting form input

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]}

SanfordWhiteman
Level 10 - Community Moderator

Re: Alert email not reflecting form input

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).

Simone_Toit
Level 2

Re: Alert email not reflecting form input

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.

SanfordWhiteman
Level 10 - Community Moderator

Re: Alert email not reflecting form input

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