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

Question

Question

Allow Tokens in Pattern Matching [Conditional Token Masters in SQL]

asked on August 13

Hello Everyone,

I have been trying to use "Allow Tokens" in Pattern Matching but somehow not succeeding and must be missing something. This Use Case is using Workflow 10.4 as mentioned below

Step 1 : Extract Country Name from "Retrieve Document Text"

Step 2 : Query Data in Database which says if it INDIA then look for (\d{6}) and if it US then look for (\d{4})

 

These conditional tokens works fine in case when used with \d{6}|\d{4} as these are distinct, but in certain cases it fails where Supplier is from US but Buyer is in India and thus depending on position it returns either.

Please guide us if this usecase is not supported and we can use token only as a part of RegEx but not as RegEx.

 

Rgds

Shreyas

Workflow.png
Pattern Matching.PNG
Workflow.png (27.59 KB)
0 0

Replies

replied on August 13

You probably want to try something like enforcing that there's a space before and after the US value to ensure that (\d{4}) will not match on the first 4 digits in the Indian value.

1 0
replied on August 14

Thank you Miruna. We basically want to use Pattern Repository and thus when it reads "US" than by Query Data we are pulling (\d{4}), but this is not returning results. When we pass \d{4} instead of Query Data token then it works.

 

Can you help me with understanding if we can use Query Data Token and if we should expect it to work without a manual approach? This will help in designing the dictionary building process for many processes.

 

Rgds

Chandresh

0 0
replied on August 14

There's not enough information for to troubleshoot. It could be that your query returns multiple rows and the first pne has a blank pattern. Or that you're using a char column for the value and SQL pads the value with blank spaces.

Try tracking your tokens before the Pattern Matching activity to see if you have the right pattern at that point.

0 0
replied on August 14

Hi Miruana,

I understand your point of view and infact I just want to ensure that if query returns (\d{4}) as a single row does this become a support case.

Please excuse me for this as support cases most of the time say that for “How To” queries we should go to “answers” portal and not “support”.

In our case there only two rows in database one with US and another with INDIA and track token is showing right pattern value returned. Please confirm technically if our understanding is correct in how “Allow Token Values” should work.

Look forward to your valueable feedback.

 

Rgds

Chandresh

0 0
replied two days ago

Hi Miruana,

We will create a support case for mentioned troubleshooting purposes. Thank you.

Rgds

Chandresh

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

Sign in to reply to this post.