an_old_user
Novice

Re: Extract data from text column

Jump to solution

In the latest version you've swapped a ':' for an '=', this will need reflected within the RegEx.   Switch out the colon for an equals.

0 Kudos
Reply
Not applicable

Re: Extract data from text column

Jump to solution

I'm getting this output

10Meeting=90Research=20Transferred=40

So should there be some changes on the Regular expressions action?

0 Kudos
Reply
janp
Rookie

Re: Extract data from text column

Jump to solution

You're getting this because you're using a Replace function on the entire ItemCollection. You are in essence turning it into just a single string by removing the ";" delimiter.

An approach you could use would be first, as Barry had suggested, use RegEx action to split the single string into a collection.

Then iterate through the collection using a For Each loop.

In the For Each loop, you THEN use RegEx or Replace or Substring() or whichever approach you want to extract the value.

e.g.

Initial string = "Text1: Text1value; Text2: text 2value"

After the initial split you will have a site collection that will contain 2 strings:

Text1: Text1value

Text2: text 2value

Then in the foreach loop you assign each value to a var - tempString

first iteration will be tempString = "Text1: Text1value"

At this point you can finally use a function to either remove the Text1: from the string, or read a substring based on the length of "Text1"

Also, a note on using Replace(), I found using it can give unexpected results unless you use {TextStart} and {TextEnd}.

e.g. fn-replace({TextStart}tempString{TextEnd},"Text1:","")

Regards,

0 Kudos
Reply
Not applicable

Re: Extract data from text column

Jump to solution

Hi,

So I made some changes to the workflow

1. Regular Expression

Output is stored in 2nd which is a collection variable. So ideally the output should be

Follow Up=224

Transferred=20

2. Using For each

Output is stored in 2nd String which is a single line text

3. Regular expression

Output is stored in 2nd Variable Output which is single line text

Note: If I used "Extract" option, the value should be stored in a collection variable which I don't know how to relate. And if I use Collection variable option, I don't know where and what the Index should be.

However, the output is not displayed. Can you please suggest?

0 Kudos
Reply
vadim_tabakman
Nintex Employee
Nintex Employee

Re: Extract data from text column

Jump to solution

Hi Chandra,

 

use a Regular Expression action and configure it perform an Extract.

Expression --->   (?<=Follow Up=)\d+(?=;)

 

 

Store the result in a Collection variable.

Finally, add a Collection Operation and configure it to do a Pop.

 

 

The result should be a variable that contains the 45.

 

 

cheers,

Vadim

View solution in original post

0 Kudos
Reply
Not applicable

Re: Extract data from text column

Jump to solution

Hi Vadim,

Thank you very much for your help. I was able to extract the data by following your suggestions.

0 Kudos
Reply