cancel
Showing results for 
Search instead for 
Did you mean: 

How to split string at specified delimiter/separator in Nintex Workflow for Office 365?

teowt
Nintex Newbie
4 5 11.1K

A tricky & alternative solution to split string at specified delimiter.


Thanks to KuanChiang Lui to provide this Trick.

Scenario: There have a string value (Delimiter strings) that returned from a data source or response value from a web request (SOAP or REST) and would like to split it and store into a dictionary.

Example Input

Text = “1,2,3,4,5,6,7,8,9,10‌”

Expected Output

Dictionary = ["1","2","3","4","5","6","7","8","9","10"]

Solutions: Check out the step by step below.

Pre-requisites: Create a Text Variable and set value with "1,2,3,4,5,6,7,8,9,10".

{Variable: String to Split} = 1,2,3,4,5,6,7,8,9,10‌

Step 1: Apply “Set Workflow Variables” action and configure to add XML node in between “String to Split”.

Step 2: Apply “Replace Substring in String” action and configure to replace the delimiter “,” with XML node.

The Output “String to Split” is becomes a valid XML as below.

<values>

                <value>1</value>

                <value>2</value>

                <value>3</value>

                <value>4</value>

                <value>5</value>

                <value>6</value>

                <value>7</value>

                <value>8</value>

                <value>9</value>

                <value>10</value>

</values>

Step 3: Apply “Query XML” action and configure to query the values into dictionary.

Result: Return the string in dictionary format

{Variable: Output in Dictionary} = ["1","2","3","4","5","6","7","8","9","10"]


The enclosed attachment is the sample workflow that has been configured with steps above. You can import to Site workflow in Nintex Workflow Office 365.

Cheers!!!

Tags (2)
5 Comments
akrasheninnikov
Nintex Newbie

Usable for CAML queries <Query><Where><In><FieldRef Name="..." /><Values><Value Type="...">...</Value>...</Values></In></Where></Query> from a LookupMulti value. I was considering to share this as well.

Seems like Regex is a bit more elegant and simpler to implement when you know how.

teowt
Nintex Newbie


Hi Alexey Krasheninnikov

Thanks for sharing! I think this action(Regular expression) is not available in Nintex Workflow Office 365.

akrasheninnikov
Nintex Newbie

I didn't notice this was O365 space. Then, a [Learn More] blog post could still be welcome?

Not applicable

For sure! A blog post in Learn More is welcome Alexey

allan
Nintex Newbie

You can just use a Regex to split on the comma Smiley Wink it's way easier