Re: Is there a way to set tokens to output either true or false/yes or no instead of 1 or 0?

Anonymous
Not applicable

Is there a way to set tokens to output either true or false/yes or no instead of 1 or 0?

Is there a way to set tokens to output either true or false/yes or no instead of 1 or 0?
Tags (1)
7 REPLIES 7
Jep_Castelein2
Level 10

Re: Is there a way to set tokens to output either true or false/yes or no instead of 1 or 0?

Use a text field instead of a boolean. The boolean field will contain the value that was entered, which could be either true/false, yes/no or 0/1. So if you upload a list with true/false, that's what the token will output. If you upload a list with yes/no, then that's what will be outputted. 

UPDATE: This is NOT CORRECT, see my explanation below
Anonymous
Not applicable

Re: Is there a way to set tokens to output either true or false/yes or no instead of 1 or 0?

I had written the following article for the commuity but it was recently deleted:

Boolean checkbox fields actually store the value 0 when unchecked (false) and 1 when checked (true).

Boolean fields are available to be used as tokens in emails and landing pages but by default they will just return 0 or 1 depending on whether or not the value is checked. This may not be very presentable to your leads, for example if you use a subscription centre where newsletters are checkboxes and you might want to send an email to subscribers showing them what they have and have not subscribed to.

If you just use the token that represents the standard boolean field then the check mark you see in the above email will be a the number 1.

In Admin go to field management click on New Custom field and you can create a new Marketo only field of type formula. You will add an if choice and specify the name of the boolean field like below
0EM50000000QRE5.jpg

This formula field looks at the boolean field and displays ✓ if the real checkbox field has been checked (True), if not it displays the default value ✘.

So you would just need to replace the symbols with TRUE/FALSE.
 

Jean-Pascal_Mer
Level 4

Re: Is there a way to set tokens to output either true or false/yes or no instead of 1 or 0?

This does not seem to work anymore as I can't see how to create a Marketo field only in the Field Management. Has anyone any other way to do this?

Thanks

JP

Jean-Pascal_Mer
Level 4

Re: Is there a way to set tokens to output either true or false/yes or no instead of 1 or 0?

Nevermind. I'm dumb.

Ishita_Chawra
Level 2

Re: Is there a way to set tokens to output either true or false/yes or no instead of 1 or 0?

Thanks for the great documentation on how to create the field. 

Question: Will this work on Landing pages and how to insert it?

Thanks, 

IC

SanfordWhiteman
Level 10 - Community Moderator

Re: Is there a way to set tokens to output either true or false/yes or no instead of 1 or 0?

Please open a new thread in Products‌.

Jep_Castelein2
Level 10

Re: Is there a way to set tokens to output either true or false/yes or no instead of 1 or 0?

Cathal: that is a great solution, thanks. 

I did test my earlier statement, and it was not correct. Boolean is indeed stored as 0 and 1. The only situation where I saw it being exported as I described above (yes/no or true/false) was a situation that was customized for a particular customer, so it would not apply to other Marketo customers.