Database Validation in a workflow step

  • 29 December 2020
  • 4 replies

Badge +1

I have a form/view that is SO heavy in database calls, that users are complaining on how long it takes. 


I have a form value that needs to be validated against a database to see if the value exists.  There are thousands of possibilities for this value.  We have done what we can to try and widdle down the error rate for this value, but still get occasional bad values later down the line. 


Does anyone know how to do a function or data validation within a workflow step?  I dont mind the validation being done after form submittal, and if data validation does not pass, that the workflow go a different direction. 


4 replies

Userlevel 4
Badge +8

Can you build a stored procedure or web service that accepts the data to validate and returns true/false? You can then hook into this via SmartObject from your workflow and interrogate the results to det3ermine if it is ok or not.

Badge +1

Know of any examples or documentation on how to hook in a stored procedure or web service? 

Userlevel 4
Badge +8

I’m not sure where the documentation is, but it is pretty straight forward. If you visit your “K2 Management” site, drill down into “Integration” → “Service Instances” and then click “Add”. You can choose to add a new SQL Server Database instance or Web Service instance as one of the first fields, and then that drives what other fields become available (like SQL database name, for example). Once you create this, then you can create a Smart Object that can call anything that the service instance is pointing to. If you get this far I can help further.

Userlevel 1
Badge +4

You need to do validation in stored procedure level, then output the invalidated field/ validation error to the screen.

This the best way to validate records in bulk, example you upload excel for bulk insertion and to show the validation error to user on the screen.


another way, you can also do it in Assembly level “endpoint assembly”