2

UPDATE

I have figured out a work around to this issue (see below).

How the workaround functions.

  1. I made an new multi-line text field column... "Holder CR"
  2. When I edit the entry, I go to "Holder CR" and hit enter key once.
  3. When workflow runs, it "uses" the Holder CR "value" properly in Replace()
  4. Data returns as one line and then emailed.

THE PROBLEM

After the list entry "saves," it doesn't have the CRLF, Carriage Return value in the multi-line text field that I entered before. As a result, this causes the workflow to error.

Error occurred when performing "apples zebra dog ".Replace(, ): Value cannot be null. Parameter name: oldValue

I was thinking a workaround would to make a Calculated Column in a new column "Holder CR 2" that is the CRLF / Carriage return value. I need the formula to make a CRLF automatically (if there even is one)?

Note: I have tried =CHAR(10) with no success.

Then at the start of the workflow, I will update "Holder CR" (multi-line text) with "Holder CR 2" (calculated-value that is a "carriage return").


ORIGINAL POST

Using SP Designer 2010, I am attempting to have a Multi-Line text field (plain text) be concatenated into a single line with single-space between terms, alphabetized, and sent in an email.

Input:

apple
zebra
dog

Desired output sent in email:

apple dog zebra


My work to this point:

I use the "replace" action and I am able to replace the (CTRL+Enter) i.e. Carriage Return/New Line with "###" and it works fine, but the output sent in the email has each item still on its own line.

"Find any instance of the value in ##insert value## found in ##insert multi-line text element##, and replace it with ##insert replace value##, with the final string output to ##variable: output name##"

Output with this action:

apple
###zebra
###dog

Desired Output (note that they are alphabetized and a single-space between):

apple dog zebra

  • 1
    There isn't a Replace string action in designer 2010 ... are you actually using 2007? or have you added custom/3rd party designer actions? – NiceNix Sep 2 '16 at 18:09
  • Hi NiceNIx... >> It is definitely SP Designer 2010. I type in "replace" and it gives me the action of: Find any instance of the value in <insert value> found in <insert multi-line text element>, and replace it with <insert replace term>, with the final string output to <variable name> Thanks for comment / clarification! – Cyberfan1999 Sep 2 '16 at 18:21
  • I'M SO SORRY NiceNix... >> Yes, our SP Admin added a 3rd party "Sting Actions" .wsp from codeplex. I hope this helps trigger something in your brain for a resolution. :-) spdwfstringactions.codeplex.com – Cyberfan1999 Sep 2 '16 at 18:39
0

Not sure where you got your Replace function from, it isn't a native workflow action, but I have a decent guess as to why you are seeing the behaviour you are for trimming out new lines...

Typically CTRL-ENTER gets interpreted as just LF. A multiline textfield stores new lines as CRLF in standard windows fashion. The CR you are leaving behind in your pattern matching is likely the cause of the mystery newlines. Does your replace function accept escape characters? could you pass it a \n instead?

As for the alphabetical order part of your question, there is nothing in native SharePoint Designer that allows you to put a sort order on anything in a workflow. Perhaps you have another custom workflow action you could leverage to sort it?

  • The replace function came from a 3rd party off codeplex... spdwfstringactions.codeplex.com -- the page says that it is based on the .NET replace function... msdn.microsoft.com/en-us/library/fk49wtc1.aspx ........................................................ I attempted to use \n and it did not "fix" the results. I even tried it with ASCII code for the element ........................................................Very frustrating... :( – Cyberfan1999 Sep 2 '16 at 19:15
  • Hi........ I'm on the cusp of figuring this out........ Can you assist? I need to make a CALCULATED VAULE list item that will insert a single......... CRLF.............. i.e. =INSERT(CRLF).................. Something like that, et al...... Thank you! – Cyberfan1999 Sep 2 '16 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.