Based on your databasis e.g. invoice number go through a specific group/folder of documents and search this invoice number. If the invoice number is found, go trough the same document/page to find the corresponding incoterm (or any other predefined string)