SharePoint Designer workflow string actions

Learn which workflow actions to manipulate strings are available in SharePoint Designer 2013.

ADVERTISEMENTS

SharePoint Designer 2013 comes with the following Utility Actions you can use to manipulate strings in a SharePoint workflow:

Extract Substring from Start of String

This action returns the first characters in a text string based on the number of characters you specify. When you add this action to a SharePoint workflow, the following sentence is displayed:

Copy 0 characters from start of string (Output to Variable: substring)

Example:

If you have the sentence "SharePoint Designer 2013 can be used to create no-code SharePoint workflows" and you want to retrieve the string "SharePoint Designer 2013" from the sentence, you would have to configure the Extract Substring from Start of String workflow action as follows:

Copy 24 characters from start of SharePoint Designer 2013 can be used ... (Output to Variable: substring)

substring contains the result, which would be the string SharePoint Designer 2013.

Extract Substring from End of String

This action returns the last characters in a text string based on the number of characters you specify. When you add this action to a SharePoint workflow, the following sentence is displayed:

Copy 0 characters from end of string (Output to Variable: substring)

Example:

If you have the sentence "SharePoint Designer 2013 can be used to create no-code SharePoint workflows" and you want to retrieve the string "SharePoint workflows" from the sentence, you would have to configure the Extract Substring from End of String workflow action as follows:

Copy 20 characters from end of SharePoint Designer 2013 can be used ... (Output to Variable: substring)

substring contains the result, which would be the string SharePoint workflows.

Extract Substring of String from Index with Length

This action returns a specific number of characters from a text string, starting at the position you specify, based on the number of characters you specify. The starting position is zero-based. When you add this action to a SharePoint workflow, the following sentence is displayed:

Copy from string, starting at 0 for 0 characters (Output to Variable: substring)

Example:

If you have the sentence "SharePoint Designer 2013 can be used to create no-code SharePoint workflows" and you want to retrieve the string "no-code SharePoint" from the sentence, you would have to configure the Extract Substring of String from Index with Length workflow action as follows:

Copy from SharePoint Designer 2013 can be used ..., starting at 47 for 18 characters (Output to Variable: substring)

substring contains the result, which would be the string no-code SharePoint.

Extract Substring from Index of String

This action returns characters from a text string, starting at the position you specify, until the end of the text string. The starting position is zero-based. When you add this action to a SharePoint workflow, the following sentence is displayed:

Copy from string, starting at 0 (Output to Variable: substring)

Example:

If you have the sentence "SharePoint Designer 2013 can be used to create no-code SharePoint workflows" and you want to retrieve the string "no-code SharePoint workflows" from the sentence, you would have to configure the Extract Substring from Index of String workflow action as follows:

Copy from SharePoint Designer 2013 can be used ..., starting at 47 (Output to Variable: substring)

substring contains the result, which would be the string no-code SharePoint workflows.

Find Substring in String

This action finds one text string within a second text string, and returns the number of the starting position of the first character of the first text string in the second text string. The starting position is zero-based. When you add this action to a SharePoint workflow, the following sentence is displayed:

Find substring in string (Output to Variable: index)

Example:

If you have the sentence "SharePoint Designer 2013 can be used to create no-code SharePoint workflows" and you want to find "2013" in the sentence, you would have to configure the Find Substring in String workflow action as follows:

Find 2013 in SharePoint Designer 2013 can be used ... (Output to Variable: index)

index contains the result, which would be number 20.

Replace Substring in String

This action replaces all occurrences of a text string (first text string) within a text string (third text string), with a different text string (second text string) you specify. When you add this action to a SharePoint workflow, the following sentence is displayed:

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

Example:

If you have the sentence "SharePoint Designer 2013 can be used to create no-code SharePoint workflows" and you want to replace all "Sh" characters with an "x" in the sentence, you would have to configure the Replace Substring in String workflow action as follows:

Replace Sh with x in SharePoint Designer 2013 can be used ... (Output to Variable: output)

output contains the result, which would be the string xarePoint Designer 2013 can be used to create no-code xarePoint workflows.

Note:

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

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)

Example:

If you have the sentence " SharePoint Designer 2013 can be used to create no-code SharePoint workflows " and 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 SharePoint Designer 2013 can be use ... (Output to Variable: output)

output contains the result, which would be the string SharePoint Designer 2013 can be used to create no-code SharePoint workflows.

Other common string manipulations

Other common string manipulations for which there are no specific workflow actions in SharePoint Designer 2013 include:

However, all of these string manipulations can be simulated in a SharePoint workflow by finding creative workarounds.

Related Articles

ADVERTISEMENTS