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

Question

Question

Pattern Matching Test Results Different Then When Workflow Runs

asked on April 6, 2023 Show version history

I am building a workflow that retrieves the text of a txt file in the repository and parses the data using regular expressions. When I test the regular expressions in the Workflow activities everything looks to be configured correctly, but when the workflow runs I get different results.

Here is a sample of the text file text:

A|20150120|77432|SF|123456789|1|1|CHK|1|1.00|1112223101|123456789|20150129|121000248|Circle K||||000001.tif||
A|20150120|77432|SF|123456789|1|1|INV|1|||||||123456|1.00||||
A|20150120|77432|SF|123456789|1|1|WHT|1||||||||||000002.tif|000003.tif|
A|20150120|77432|SF|123456789|1|1|WHT|2||||||||||000004.tif|000005.tif|
A|20150120|77432|SF|123456789|1|2|CHK|1|2.00|1112223102|123456789|20150129|121000248|Circle K||||000006.tif||
A|20150120|77432|SF|123456789|1|2|INV|1|||||||234567|2.00||||
A|20150120|77432|SF|123456789|1|2|WHT|1||||||||||000007.tif|000008.tif|
A|20150120|77432|SF|123456789|1|2|WHT|2||||||||||000009.tif|000010.tif|

I have a pattern matching activity that is within a For Each Value activity and is configured as follows:

A second token is created in the same Pattern Matching activity after the CheckGroup token and is configured as follows:

You can see that in testing the values are found as expected.

When the workflow runs though, it only finds the first .tif value instead of all of them within the CheckGroup token:

I might have been staring at this for too long and missing why it is not grabbing all of the values, but if someone sees something I'm not or has any ideas to try, please let me know.

0 0

Answer

SELECTED ANSWER
replied on April 6, 2023 Show version history

I know the feeling!  Sometimes you just need another pair of eyes.

I'm guessing the issue is because your first pattern match token creates a multi-value token, which you then feed into the second pattern match token as a single value token.

I think you'll need a "For Each Value" activity to loop through the results of the first token in order to run the second pattern match on each value.

EDIT TO ADD: Or if you want to leave it as is, I think (I did not test) that on the Input for the second pattern match, you could use the token dialog to re-combine the multi-values from the previous token, with a semi-colon separataor and then change your RegEx to look for (\w.).tif;

2 0
replied on April 6, 2023

Brilliant! While it wasn't exactly what I needed, it got me to what the underlying issue was. I did not need the first pattern match to be a multi-value token. I switched it to 'All matches (combined with no spaces)' and that did the trick. Thank you for taking the time to review this for me Matthew.

1 0
replied on April 6, 2023 Show version history

Awesome!  I'll always remember that one time I helped Blake Smith solve a problem.  wink

Since it's usually you helping me figure my stuff out.

1 0

Replies

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

Sign in to reply to this post.