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

Question

Question

Pattern Matching Tests Correctly But Returns No Data

asked on March 11, 2024

I'm attempting to use pattern matching on a section of my document to retrieve the Batch number from the Description.

 

 

When I test the pattern match, it works.

When I run the workflow, however, no values are returned.

In my workflow, I'm running the pattern matching and then assigning it to a token but since the Pattern Matching returns as blank so does the token.

Can anyone provide a suggestion about what I may be doing wrong/missing?

0 0

Answer

SELECTED ANSWER
replied on March 11, 2024

Oh, you didn't mention the data is coming from capture profiles.  Capture profile returns multiple lines of text as a multi-value token. You'd need to collapse it into a paragraph by using token indexing.

1 0

Replies

replied on March 11, 2024

That worked! Many thanks!

1 0
replied on March 11, 2024

I wonder if the line break after the Batch: line is showing up differently than you expected.  You could use the Track Tokens activity to verify how the data comes out of the Run Capture Profile activity.

You could also try editing the pattern to be more forgiving of a line break.  Maybe something like this (which I haven’t tested):

Batch\:[\W\n]+(\d{10})


This says: 

Look for the exact text “Batch:”
Followed by at least one - either newline character or non-word character.
Followed by exactly ten digits.
We only want to retrieve the ten digits.

 

0 0
replied on March 11, 2024

Line break in text pages are \r\n, not just \n.

1 0
replied on March 11, 2024

Oh, haha - it's too early on a Monday.

Updated pattern: 

Batch\:[\W\r\n]+(\d{10})

 

0 0
replied on March 11, 2024

I didn't get any results with that either.

0 0
replied on March 11, 2024

Here's what I have

The flow

The pattern Matching for Lot

 

The pattern matching on the token:

 

And I've assigned all three to the Lot field in hopes of a response from one of them.

 

This is the runcaptureprofile_lot (original data)

These are the results from the pattern matching and token

0 0
SELECTED ANSWER
replied on March 11, 2024

Oh, you didn't mention the data is coming from capture profiles.  Capture profile returns multiple lines of text as a multi-value token. You'd need to collapse it into a paragraph by using token indexing.

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

Sign in to reply to this post.