SharePoint Designer 2010 workflows will remove back slashes in dynamics strings if the Workflow Actions uses lookup data and static text when the workflow executes.


Symptoms


Microsoft SharePoint Designer 2010 Workflow that contain an Action that combines static text with lookup, which is called a dynamic string, will remove backslashes that have been entered into the dynamic string.

For example:
  1. You enter a 'set field in current item' action to your Workflow,
  2. click on 'Field' and select 'Title',
  3. click 'Value' followed by '...' and enter (without the quotes) "There should be a backslash after this: \ and two after this: \\" and
  4. add a lookup value by clicking the "Add or Change Lookup" button; for the 'Data Source' keep it on "Current Item" and in 'Field From Source' select "Modified by" (or any other lookup item)
When the Workflow is executed the result in the Title field will look like:
"There should be a backslash after this: and two after this: \ domain\alias"

Resolution


If you are creating a dynamic string with one or more back slash characters you need to duplicate each backslash. To get one back slash, two back slash characters have to be specified in the Workflow definition. To get two back slashes, four back slashes have to be specified, etc.

For the existing example the dynamic string for the Workflow action has to be specified as:
"There should be a backslash after this: \\ and two after this: \\\\"

More Information


Please note that this duplication of back slash characters is only needed if you have a dynamic string with lookups. If you have a pure static string without any lookups then back slashes don't have to be duplicated.