MetaServer > Help > Extract > Lookup with Stored Procedure

120-300 MetaServer Extract – Lookup with Stored Procedure

With the MetaServer Lookup with Stored Procedure rule, you can implement a complex data-validation routine using stored procedures.

A stored procedure is a subroutine available to applications that have access to a relational database management system. MetaServer support Microsoft SQL Server stored procedures.

We initially implemented the Lookup with Stored Procedure rule for a citrus fruits shipping company who wanted to trigger an email notification as soon as all the paperwork for a given shipment was complete.

The stored procedure checks the following things:

1) The presence of a complete document set for a given container.
2) If the document set is complete, the stored procedure returns “TRUE” as the value in the result variable @TriggerNotification.
3) If the document set is still incomplete, the stored procedure returns “FALSE” as the value in the result variable @TriggerNotification.

Every time a new document is processed, we check through the stored procedure if @TriggerNotification = TRUE or FALSE and map this value with the MetaServer field “Email Trigger”. Using a Distribute action, we export to an Export to Email action if the “Email Trigger” is TRUE. If it’s “FALSE”, it skips the email notification.
Lookup with Stored Procedure rules are defined in a MetaServer Extract or Separate Document / Process Page action.

To add this rule, press the Add button and select Find -> Lookup -> Stored Procedure.

If you would have any questions regarding the setup of your Lookup with Stored Procedure rule for your specific solution, please contact us.

TIP: you can copy the current settings and paste them in another setup window of the same type. Do this by pressing the Settings button in the bottom left of the Setup window and by selecting Copy. Then open another setup window of the same type and select Paste.