SOLVED

Re: Concatenate string in Flow Step doesn't work. Boolean the problem?

Go to solution
Gerard_van_den_
Level 3

Concatenate string in Flow Step doesn't work. Boolean the problem?

I am working on the GDPR compliance and wanted to list the selected opt-in(s) for the various types of content in my custom field Consent Notes. It keeps giving me an error though, so I'm wondering what's the problem. Here's the full thing I started off with in my Change Data Value flow step:

{{system.dateTime}} | Consent set to TRUE | http://page.woodwing.com/subscription-center.html | Yes, WoodWing can use the information I provide on this form to send me communication in line with my preferences above. | Newsletters={{lead.Newsletter opt-in}} | Events/Webinars={{lead.Events / Webinars opt-in}} | Whitepapers/eBooks={{lead.Whitepapers / eBooks opt-in}}

The step worked without the last part where I list the different opt-ins.

To find the error I brought it back to the basics:

{{Lead.Events / Webinars opt-in}}

And still get an error in my Activity Log: Choice had one or more invalid tokens.

I even went into the rich editor to make sure I use the right tokens by having the editor fill them and them copy and paste them. I'm sure the token is correct.

Is the conclusion that I cannot concatenate Boolean values in a string variable?

1 ACCEPTED SOLUTION

Accepted Solutions
SanfordWhiteman
Level 10 - Community Moderator

Re: Concatenate string in Flow Step doesn't work. Boolean the problem?

I'd use a datetime field here instead, stamped with the time someone opted in. It carries more information and is (as you know) stringified as expected. Really, booleans are not as useful as they seem; save for data storage requirements (only taking up a bit, which few people care about w/a system like Marketo) they don't represent anything a non-empty datatype can't do just as well.

View solution in original post

8 REPLIES 8
Gerard_van_den_
Level 3

Re: Concatenate string in Flow Step doesn't work. Boolean the problem?

So in the meantime I did find out that indeed I cannot use Boolean in the String concatenation - that's a pity, really.

Anybody any suggestions how to squeeze this information in a string?

SanfordWhiteman
Level 10 - Community Moderator

Re: Concatenate string in Flow Step doesn't work. Boolean the problem?

I'd use a datetime field here instead, stamped with the time someone opted in. It carries more information and is (as you know) stringified as expected. Really, booleans are not as useful as they seem; save for data storage requirements (only taking up a bit, which few people care about w/a system like Marketo) they don't represent anything a non-empty datatype can't do just as well.

Keith_Nyberg2
Level 9 - Champion Alumni

Re: Concatenate string in Flow Step doesn't work. Boolean the problem?

Awesome work around Sanford Whiteman​!

Then you can set the default token value to FALSE and you either have a date when marked true or a FALSE value.

Screen Shot 2018-01-05 at 11.28.59 AM.png

SanfordWhiteman
Level 10 - Community Moderator

Re: Concatenate string in Flow Step doesn't work. Boolean the problem?

Gerard_van_den_
Level 3

Re: Concatenate string in Flow Step doesn't work. Boolean the problem?

Thanks Sanford, I see how this could work in a new environment. I'm afraid I have too many dependencies on the existing fields already to still make this change. But an eye opener for the use of Booleans vs. other types of variable in general!

Keith_Nyberg2
Level 9 - Champion Alumni

Re: Concatenate string in Flow Step doesn't work. Boolean the problem?

Hey Gerard,

I tested this and received the same result. Options to resolve this include:

  • changing your boolean field to string type in admin with values NULL, False, and True. Unfortunately this means you lose existing data but you can always export a list of TRUE values, make the change and append. (Good article on restrictions when changing fields and what happens to your data with each type of change:Changing the Field Type of a Marketo Field - Deep Dive )
  • creating a new custom string field that mirrors the boolean field with 2 simple smart campaigns to manage the new field based on the original field value changing. Simpler to implement but creates another field with the same data which can confuse your MKTO users.

This would probably be a good idea to submit with the hopes that Marketo can provide TRUE or FALSE values for boolean fields when used in text area. Maybe there is a technical reason why this can't be done, but they should at least scope feasibility because alot of other customers will run into this same issue if they are tracking consent comments related to GDPR (which we ALL should be doing...)

Happy to submit the ida for you if you'd like. Let me know.

Sincerely,

Keith Nyberg

Gerard_van_den_
Level 3

Re: Concatenate string in Flow Step doesn't work. Boolean the problem?

Thanks Keith, very useful information. I will need to dig a bit deeper to decide what is the most appropriate solution in my case.

Anonymous
Not applicable

Re: Concatenate string in Flow Step doesn't work. Boolean the problem?

Hey Gerard,

Had to laugh when I read this post; you and I are taking a VERY similar approach to this, bud! I also worked out that booleans don't like being added to strings. And there's another gotcha, too... Marketo will write a datetime to a string in the instance timezone...

So, what I've done to overcome this is to change my Consent - Change Log (which is similar to your Consent Notes field) using choices in the Change Data Value flow step

Choice 1:

If Consent - Preference - Information Opt-In is 'true'

Attribute: Consent - Change Log     New Value: '{{lead.Consent - Preference - Information Timestamp}} (EST). User changed INFORMATION Opt-In to TRUE. {{my.linebreak}}{{lead.Consent - Change Log}}'

Default choice:

Attribute: Consent - Change Log     New Value: '{{lead.Consent - Preference - Information Timestamp}} (EST). User changed INFORMATION Opt-In to FALSE. {{my.linebreak}}{{lead.Consent - Change Log}}'

This checks the value of the relevant opt-in field and then writes the timestamp (with the instance timezone specified) and then hardcodes the change that was made to the opt-in. The bit at the end is a bit of 'Whiteman Wizardry'... it basically prepends the new change to the old one, but instead of using a pipe, it uses a token linebreak.

Almost done with my Preference Centre... it's been a slog!!

Good luck!

g