Views:

Question:
How can you set up a Workflow to check for duplicate documents?

Answer:
To set up a Workflow to check for duplicate values, the following provides an example of how this can be done.

The completed workflow will look like the following.



1. For this example, the following global variables are created;

  • DocID, which will be an Integer data type
  • Duplicate, Invoice Number, and Supplier, which will be Text data types

2. Next, an Assign Data step is created named "Initialize Variables" which contains the following assignments.

Workflow global variable = Invoice Number = Index entry of the document = Document _Number
Workflow global variable = Supplier = Index entry of the document = Company_Name
Workflow global variable = DocID = Index entry of the document = Doc ID



3. Once the Initialize Variables Assign Data activity has been created, another Assign Data step 
named "Duplicate Lookup" will be created. Please include the following assignment;

Workflow global variable = Invoice Number = File cabinet = DW_Company_Name = 'GVSupplier' and DW_Document_Number = 'GV_Invoice_Number' and DW_DWDOCID < > 'GV_DocID' and DW_DOCUMENT_TYPE = 'Invoice In"

4. In this scenario, we are performing a lookup on the Accounting File cabinet to check for any other documents where the Supplier, Invoice Number, and Document Type match and where the Document IDs do not equal the document currently in the workflow. 

Since we only need 1 result returned to confirm a duplicate, set the "Maximum number of returned rows" to 1.
If a match is found, then the duplicate variable will contain the DocID of the document found. 





5. Next, a Condition step is created, which will check to verify whether the Duplicate variable contains a value or not.

Condition = GV_Duplicate = "" or GV_Duplicate = Nothing
 


6. This statement checks if the variable is empty. If it is, it indicates that no duplicates were found. 
Otherwise, if the variable contains a value, then a duplicate was found, then you would route and update the document accordingly.

This is a simple configuration, but this can be easily incorporated into any workflow.

KBA is applicable for both Cloud and On-premise Organizations.

Comments (0)