You can use regular expressions to detect information on invoices that can be used to automatically assigns invoices to specific submitters.
For example, you receive invoices from the supplier Acme on a regular basis and want each invoice to be automatically assigned to the employee who handled the corresponding order. Each Acme invoice contains a unique reference identifying the responsible employee – for example, the employee’s ERP code. This ERP code appears within the invoice document itself and follows a specific format: a single letter followed by five digits, such as A34567.
You set up a rule to:
Define a recognition pattern for this reference using a regex rule (e.g.
[A-Z]\\d{5}).Select the User data field that should be matched – in this case, the ERP code.
For every newly uploaded invoice (whether uploaded manually or via email), Yokoy scans the PDF to detect a string that matches the specified regex pattern. When a match is found, Yokoy compares it against the ERP codes stored in the user records and automatically assigns the invoice to the user whose ERP code matches the detected value (e.g. A34567).
Depending on the target field, multiple matches may be allowed. For example, if multiple users are found, they can all be assigned as submitters to the same invoice.
Enable string matching (regex)
You create a specific rule for each string pattern you want to detect in invoices.
To create a new rule, enter the following information:
Field | Description |
Regex syntax | Regex expressions is a special type of language that allows us to recognize certain patterns.
|
Matched object attribute | Specifies the data field Yokoy matches against the string extracted by the regex from the invoice. Currently, you can only match against specific field values in Users:
|
Target invoice field placement | Specifies where the target field is located. In this case, select Invoice. |
Target invoice field | Indicates the invoice field to which the matched value is assigned. In this case, it should be Submitter. |
When all mandatory fields have been successfully configured, you can activate your newly created configuration.
Example of a possible setup
In this setup, Yokoy detects any strings that have a single letter and five numbers. It checks the string against the Employee account (ERP) field in the profiles of all users. If it finds a user with a matching Employee account (ERP), it updates the invoice with that user as the submitter.
String matching rule to detect a pattern of a single letter and five numbers.
Employee account (ERP) field found in the user profile.




