Some suppliers add extra characters to the purchase order (PO) number on their invoices, for example NOK-123456-1 when the PO in Rydoo AP is NOK-123456. Rydoo AP matches PO numbers on the exact value, so these invoices are not linked to their PO. With PO number patterns, you tell Rydoo AP how to clean up the PO number from the invoice so that it matches. You set up a pattern once per supplier format, and new invoices in that format are matched automatically.
How it works
- Rydoo AP reads the PO number from the invoice and looks for a PO with exactly that number. If it finds one, it uses it and your patterns are not applied.
- If there is no exact match, Rydoo AP applies your patterns to the PO number from the invoice, in the order they appear in the list.
- If a cleaned-up value matches a PO, the invoice is linked to that PO. If none of the patterns gives a match, the invoice stays unmatched, as before.
Patterns never replace an exact match. They only help when the exact match fails. Your other PO matching settings, such as supplier restrictions and Allow closed PO matching, still apply.
Before you begin
- You need admin access to change PO settings.
- Collect a few real PO numbers from the supplier's invoices, so you can check your pattern against them.
Add a PO number pattern
- Go to Settings. Under Client Settings, in You Are Editing, select the client you want to set up.
- Under General, select Purchase orders.
- In the PO number matching section, select Enable PO number pattern matching.
- Click Add pattern.
A new row appears with the Extraction pattern and Replacement fields. - In Extraction pattern, enter what the PO number looks like on the invoice. See Write the extraction pattern below.
- In Replacement, enter how to rebuild the PO number. See Write the replacement below.
- Click Save changes.
The pattern appears in the list and is used for new invoices.
You can add several patterns, for example one for each supplier format.
Delete a PO number pattern
- In the PO number matching section, click the delete icon next to the pattern.
- Click Save changes.
The pattern is no longer used for new invoices. If you leave the page without saving, the pattern is kept.
Note: Every change to these settings, including turning pattern matching on or off, is recorded in the Audit log tab on the same page with the user, the date, and the old and new values.
Write the extraction pattern
Both the Extraction pattern and the Replacement use regular expressions (regex). A regex is a short pattern made of letters, digits and symbols that describes what a piece of text looks like, for example "two capital letters, a dash, then six digits". Rydoo AP compares the PO number on the invoice with your pattern, and uses the parts you mark to build the PO number to look for. You don't need to know regex in depth: the examples and the symbol guide in this article cover most PO number formats. For more about regex in Rydoo AP, see Use of RegEx in Workflows and Automations.
The extraction pattern is the regex that describes what the PO number looks like on the invoice. Put round brackets around the parts you want to keep. Everything outside the brackets is dropped.
For example, the invoice shows NOK-123456-1 or NOK-123456-12. The pattern (NOK-\d{6})-\d{1,2} reads as: NOK, a dash and six digits (kept), then a dash and one or two digits (dropped). It keeps NOK-123456.
Write the replacement
The replacement tells Rydoo AP how to build the PO number from the parts your regex kept. $1 is the first part in brackets, $2 the second, and so on. You can add your own text around them.
With the pattern above, there is one kept part, so the replacement is $1, which gives NOK-123456.
If you split the kept text into two parts, you can rebuild it the way you need. With the pattern (NOK)-(\d{6})-\d{1,2}, the kept parts are NOK and 123456:
| Replacement | Result |
|---|---|
$1-$2 |
NOK-123456 |
$1$2 |
NOK123456 |
$2 |
123456 |
Examples
| On the invoice | Extraction pattern | Replacement | Result |
|---|---|---|---|
NOK-123456-1 |
(NOK-\d{6})-\d{1,2} |
$1 |
NOK-123456 |
NOK-123456-12 |
(NOK)-(\d{6})-\d{1,2} |
$1-$2 |
NOK-123456 |
AB-12345/01 |
([A-Z]{2})-(\d+)/\d+ |
$1$2 |
AB12345 |
Order 12345 |
Order (\d+) |
$1 |
12345 |
Quick guide to the symbols
| Symbol | Means |
|---|---|
\d |
A digit from 0 to 9 |
[A-Z] |
A capital letter |
[a-z] |
A lowercase letter |
[A-Za-z] |
Any letter |
\s |
A space |
+ |
One or more of the previous symbol |
{6} |
Exactly six of the previous symbol |
{1,2} |
One or two of the previous symbol |
( ) |
The part to keep |
$1, $2
|
In the replacement: the first, second kept part |
$& |
In the replacement: everything the extraction pattern matched |
Some characters, such as . ( ) + and ?, have a special meaning. To match them as plain text, put a backslash in front. For example, \. matches a dot.
Error messages
Rydoo AP checks every pattern when you save. If any pattern has a problem, nothing is saved. The field with the problem is outlined in red, with the error message below it.
| Message | What to do |
|---|---|
| Invalid extraction pattern. | Check the pattern for mistakes. For example, make sure every ( has a matching ), and put a backslash in front of special characters you want to match as plain text. |
| $2 does not exist in the extraction pattern. | The replacement uses more parts than the pattern keeps. Add brackets to the pattern or use a lower number. |
| Extraction pattern is required. | Enter a pattern or delete the row. |
Tips
- Test your pattern on a few real PO numbers from the supplier before you save. A free tool such as regex101.com shows what each part of the pattern keeps.
- Make patterns as specific as you can. A pattern like
(\d+)matches almost anything with digits in it and can link an invoice to the wrong PO. - If PO number patterns were already set up for your company before this setting was available, they appear in the list with the replacement
$&. You can delete them like any other pattern.
Note: Patterns are used for new invoices. Invoices already in Rydoo AP are not checked again automatically when you add a pattern. Your patterns are used for an existing invoice only when PO matching runs on that invoice again.
Comments
0 comments
Please sign in to leave a comment.