You are viewing limited content. For full access, please sign in.

Question

Question

Extract a substring from a value in workflow

asked on February 4, 2016

I want to pull a value from a template filed, SSN, and be able to break it up into three different groupings of numbers in workflow.  So for example, if the SSN is 123-45-6789, I want to create three values of:

1. 123

2. 45

3. 6789

I have not been able to find a way to do this in an activity or token editor.

1 0

Answer

SELECTED ANSWER
replied on February 4, 2016

Pattern Matching usually works by describing the format for your data, then indicating what you want to extract.

A SSN is usually of the format \d\d\d-\d\d-\d\d\d\d. You can break it into groups by adding parentheses around the set of characters you want to extract. So:

(\d\d\d)-\d\d-\d\d\d\d gives you the first, group, \d\d\d-(\d\d)-\d\d\d\d gives you the second and so on.

1 0

Replies

replied on February 4, 2016

use regular expression. for first token assign it ^(\d\d\d), for second [4][5], for third \d\d\d\d\Z

0 0
replied on February 4, 2016

This led me to a good start and almost a whole solution.  But my follow up question now is, for the middle two numbers they are not always a 4 and a 5 as the values.  How would I extract the middle two numbers as the values change?  I want this to run for several files with the SSN as a template field, so the middle two values will always be changing.

0 0
SELECTED ANSWER
replied on February 4, 2016

Pattern Matching usually works by describing the format for your data, then indicating what you want to extract.

A SSN is usually of the format \d\d\d-\d\d-\d\d\d\d. You can break it into groups by adding parentheses around the set of characters you want to extract. So:

(\d\d\d)-\d\d-\d\d\d\d gives you the first, group, \d\d\d-(\d\d)-\d\d\d\d gives you the second and so on.

1 0
replied on February 4, 2016

That is the perfect answer....I just wish I could have found it on my own....thank you everyone for the amazing answers.

0 0
replied on February 4, 2016

4 and 5 are index, rather than actual numbers so you should be good for any number.

0 0
replied on February 4, 2016

[4] is a range with a single value in it to regular expression.

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.