This article was created in response to a support issue logged with K2. The content may include typographical errors and may be revised at any time without notice This article is not considered official documentation for K2 software and is provided “as is” with no warranties.

Issue

Workflow email errors with this message:

Image

Symptoms

This error will occur when using a text/memo field in an email subject from an Item Reference, SmartObject, or Data field that contains the encoding:

  • newline/line feed/LF/'\n'

Image

This is similar to:

https://stackoverflow.com/questions/7239733/resolving-the-specified-string-is-not-in-the-form-required-for-a-subject

Resolution

To resolve this error, inline functions and data field manipulation can be used to remove\replace the line feed; allowing for successful sending of the email.  This will be implemented to the effect of:

  1. encoding the text field with the URL Encode() inline function; this will surface the LF as '%0a' so that it is targetable
  2. removing/replacing this '%0a' portion with a Replace() inline function (perhaps replacing the line feed with a space)
  3. decode the field again

Image

All of the inline functions can also be handled in a single data transfer event:

URL Decode(Replace(URL Encode([SubjectDataField]),%0a,[ReplacementString/EmptyString]))

Runtime Example:

Image

Workflow started with a field that has a new line/line feed.

Image

This is the email Subject with line feed replaced with space.

Image

This is the data field audit trail if each step was done in a separate transfer data event.