Extract regex value - Lower and Upper Results

mattrpa

New Member
hi all,
i should extract a product code from a string using extract regex value.
regex pattern: (?<ProdCode>[A-Z0-9]{2}[\-A-Z0-9\-]{7}[0-9]{2})
Target String: Articolo: A5-EWMS4-02 QUANTITA' 10

Result expected and verified: A5-EWMS4-02

What i am missing is how write into output collection Named Values, i tried adding the initial string as "ProdCode" but doesnt work.
the result that always obtain is a collection with 2 row named Lower and Upper.. Why?
Also, what's the scope of Collection Named Values in input?

thanks for your support
 

sivagelli

Well-Known Member
A look at "Extract Regex Values" action in the object, there will be a collection called Named Values with two rows Lower and Upper. This is being returned in yourcase.
In the process/object, when you make a call to the action "Extract Regex Values" with input collection 'Named Values', this collection overwrites the collection structure in the object and on successful execution of regex, the named capture group specified will be extracted and the value will be updated in the collection field 'Value' for the corresponding named capture group. (The named Capture group in your case here is ProdCode). You can specify one or more named capture groups and on success pattern match the values of the named groups will be updated in the collection.

Share screenshots of the process to let you know what has gone wrong.
 

mattrpa

New Member
Hi sivagelli,

here attached the screenshot

thank you
 

Attachments

  • 1.png
    14.4 KB · Views: 125
  • 2.png
    8.9 KB · Views: 115
  • 3.png
    8 KB · Views: 110

sivagelli

Well-Known Member
The Field Names of the 'Named Values' collection should be 'Name' and 'Value'. You have named fields as 'ProdCode' and 'Value'.

Add a row to the 'Named Value' collection and put 'ProdCode' in to 'Name' column and leave 'Value' field blank. On successful execution 'Value' will be updated in the collection.
 
Top