Extracting PO# or Invoice # from a Field into another Field

  • 1
  • 1
  • Question
  • Updated 8 months ago
  • Answered
From a subject field, I would like to extract any number that may be a PO# or Invoice #. For example, the subject field may say, "Strong-Tie Invoices W987567 and W23234324 on your PO# 27987324 due 3/25/2018." 

The invoice or po #'s will always contain a number and sometimes contain a letter. What is the best way to isolate and list these numbers in another field?
Photo of nancy

nancy

  • 114 Points 100 badge 2x thumb

Posted 8 months ago

  • 1
  • 1
Photo of Ⲇanom the ultimate (Dan Diebolt)

Ⲇanom the ultimate (Dan Diebolt), Champion

  • 26,262 Points 20k badge 2x thumb
Easy - use this native Rich Text formula field:

"<div class='Vibrant Success' onclick=\"var QBU_subject=_fid_6.value;var QBU_matches = QBU_subject.match(/([a-z]?[0-9]{5,})/gi);_fid_7.value=QBU_matches.join('\\n');\">Parse</div>"
Demo below:

Before pressing Parse button:




After pressing Parse button:




Parse With Script
https://haversineconsulting.quickbase.com/db/bnhq45zk4?a=nwr

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=642
Photo of nancy

nancy

  • 114 Points 100 badge 2x thumb
WOW! THANK YOU SO MUCH!!