Pages

Sunday, December 20, 2015

String Functions in SharePoint Designer Workflows 2013

SharePoint Designer 2013 contains the some useful utility actions as follows which can manipulate strings in designer workflows.

 - Extract Substring from Start of String
 - Extract Substring from End of String
 - Extract Substring of String from Index with Length
 - Extract Substring from Index of String
 - Find Substring in String
 - Replace Substring in String
 - Trim String

In this post you will get to know that how to use Replace Substring in String and Trim String.

Trim String

This action removes leading and trailing spaces from a text string. When you add this action to a SharePoint workflow, the following sentence is displayed:

Trim string (Output to Variable: output)

ex: Let's say you have column name "Employee Master" and there some records exists in the list which has value " David Jone Byrne " for "Employee Name". Now you want to remove all leading and trailing spaces from the sentence, you would have to configure the
Trim String workflow action as follows:

Trim  David Jone Byrne (Output to Variable: output)

output contains the result, "David Jone Byrne"
-------------------------------------------------------------------------------------------------------------

Replace Substring in String

This action replaces particular substring with another substring.

1. Create New SharePoint Designer Workflow 2013
2. Go to Action under Insert tab and select Replace Substring in String under Utility Actions. You will get following line in your workflow.

Replace string with string in string (Output to Variable:output)

ex: Let's say you have column name "Employee Master" and there some records exists in the list which has value "David Jone Byrne" for "Employee Name".
Now you have to to replace the word "John" with the word "Christoper". Lets see how to do that.

Replace John with Christoper in David Jone Byrne (Output to Variable:output)

output contains the result, "David Christoper Byrne"

Note: This SharePoint Designer workflow action could be used for upper- and lower-casing words or sentences in a SharePoint workflow.
-------------------------------------------------------------------------------------------------------------

No comments:

Post a Comment