I have a text column where users fill in some information in this format
"Text1: Text1value; Text2: text 2value"
Is it possible to extract the Text1value from it? I'm using Nintex 2013 Enterprise
Solved! Go to Solution.
Yes this can be achieved using 'Regular Expression' action and some looping.
First split by ';' into a collection:
Next loop through each item in the collection:
Remove the leading 'Text1:' part and leave only the value:
Hope this helps you solve your problem.
Thanks for your reply. If I want to get the text2value, should I used parallel branches right after the For each loop? And how can I identify / differentiate the values for Text1 and Text2?
The suggestion above will only give you the text values in order one after another within the loop. If you want to specifically pull out 'Text1' or 'Text2' values you will need a slightly different approach.
Use a Regular Expression action to extract the item you require, this action can be performed alone and does't require any of the items listed above:
Regular Expression Pattern:
Change the 'Text1' part of the expression to the value name you require.
Sorry I think I didn't explain the requirement correctly. I want to extract and store the Text1 and Text2 data as well. So should I go ahead and use a parallel branch right before the start of Regular expression to get Text1 and Text2 outputs?
I'm getting "Coercion Failed: Unable to transform the input lookup data into the requested type" error. This is what I'm doing
Step 1: Regular Expression
itemcollection is an collection variable
Step 2: For each
textitem is single line text
Step 3: Regular expression
textvalue is single line text
Step4 : Set a field's value
Please let me know if there are any corrections to be made. The workflow Info states that there's an error in For each and Set a field value actions. Thank you
Barry, I followed your instructions. However, I'm unable to store the output in Set a field's value action
Here what I'm doing:
Step 1: Regular expression and extracting just the Text1
Output is stored in itemcollection which is a Collection variable
Step 2: Collection operation
Output: Storing the result in textvalue(single line text)
Step 3: Set a field's value
I'm getting this error "Error operating on collection variable. Index property is greater than the number of items in the collection". Any suggestions?
The collection above will only every contain a single result and 'index' variable is exceeding this.
Lets try once more. The following will retrieve 'Text1' value and set a list field with that value.
Regular Expression - Get 'Text1' value:
Obviously you will replace the 'Input Text' field with your variable which contains this string.
Set Field - Ensuring any erroneous ';' are removed:
You may which to clean up the replace function to only trim out leading semi-colons. If you don't think this will be an issue you can leave as is.
Let me know how you get on.
Barry, thank you for replying. However, its not working.
Step 1: Regular Expression
Storing output in itemcollection
Step 2: Set field value
Though the workflow finished without errors, the Follow up column doesn't contain any data. Ideally the output should be 10