FlowBoost loves your line breaks

Marketo user CDD (also an existing FlowBoost user) opened this Community thread the other day that brought up another way FB can save your bacon.

He writes:

When using a ''Change Data Value'' flow step in a smart campaign, the text area to enter the new value is really small.

But being small (in width) is only part of the problem:

ss_ui

The other part is it's not really a “text area” in the sense of an HTML <textarea>, but rather a one-line <input="text">.

As such, any line breaks in your New Value are stripped out. That's really cumbersome: if you're trying to sync with an SFDC textarea field, you want multiple lines. (You may be putting {{lead.tokens}} on different lines, or a preset block of paragraph text.)

If you call a webhook to set field values, though, line breaks are no problem. This is hardly a top-line feature of the 'Boost, but for static multiline text, you can just wrap it in backticks (i.e. a JavaScript template literal, which supports line breaks):

var mktoDescription = 
`This
is
a
multi-line
text
field`;

If you're embedding tokens, you should be more careful with escaping and do it in 2 steps, an object and then the template literal:

var Lead = {
  FirstName: {{Lead.First Name}},
  LastName: {{Lead.Last Name}},
  Email: {{Lead.Email Address}},
  ContactRequested: {{Lead.Contact Me}},
  PrimaryRole: {{Lead.Job Title}},
  AdditionalInterests: {{Lead.Additional Interests}}
};

var lastFormFilloutSummary = 
`Name: ${Lead.FirstName} ${Lead.LastName}
Email: mailto:${Lead.Email}
Contact Requested: ${Lead.ContactRequested}
Primary Role: ${Lead.PrimaryRole}
Additional Interests: ${Lead.AdditionalInterests}`;

[1]But either way, FlowBoost has you covered.

Learn template literals!

By the way, JS template literals — not supported in still-around browsers like IE 9-11, so unsafe on public pages — are lifesavers in your browser's F12 Console (assuming you yourself aren't using IE).

Using the Console to parse text w/JS functions is really handy. But if you paste lines from a CSV, or a bunch of free-form text from a Word document, you must wrap it in backticks, not quotes (’cuz line breaks aren't allowed in regular strings, not to mention that your text might have unescaped single or double quotes).[2]


Notes

[1] Ask in the comments if you don't know why this is a better approach than just the one template literal.
[2] Well, yeah, unless the text itself has unescaped backticks, but make sure that doesn't happen!