Skip to main content

Match a submitter with an invoice automatically

Yokoy Invoice allows you to automatically assign invoices to certain submitters using regex syntax.

Written by Yokoy Team
Updated over 2 months ago

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:

  1. Define a recognition pattern for this reference using a regex rule (e.g. [A-Z]\\d{5}).

  2. 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.

  1. Go to Admin > Invoice business rules.

  2. Select the String matching (regex) tab.

  3. Click Add regex.

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.
Let’s say that you have a book and in this book you want to find the word that contains the numbers 567 followed by a certain alphabetical number of letters, like APPLE (the string would be 567APPLE). Regex allow you to write a certain syntax pattern to extract exactly that exact string pattern from the data.


You can test the pattern directly from the setup. It checks that the pattern contains correct regular expression syntax.

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:

  • Email

  • Employee account (ERP code)

  • Custom field (any custom fields that may have been set up for your company in the user profile)

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.

Note: If you are unsure what regular expression would work for your specific case, you can use online tools such as regex101 to create your regular expression or reach out to Yokoy.

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.

Did this answer your question?