You are viewing limited content. For full access, please sign in.

Question

Question

Workflow Custom Query Return Status

asked on April 20, 2018

We have a form that is prompting for demographic information about a student - examples: permission to display artwork, student email, phone numbers, preferred language for correspondence, guardian and emergency contact information.

We are using workflow to transfer information from the form to a "staging" table in SQLSERVER.  A snippet of the workflow :

One of the custom queries looks like this:

INSERT INTO Student_Contact_Staging (BPID,BPName,InstanceID,StudentID,Language,HomePhone,CellPhone)
VALUES 
( @BPID,@BPName,@InstanceID,@StudentID,NULLIF(@Language, ''),NULLIF(@HomePhone, ''),NULLIF(@CellPhone, '') ) )

 

The workflow and custom queries work.

During testing there were a few columns in the staging table that were not large enough and the insert did NOT happen. The workflow completed with NO indication there was an issue. We increased the size of the staging table columns to resolve the issue. 

My question is there a "return" code we can capture so that we KNOW there is an insert issue that needs attention?  Having the workflow complete "successfully" with a missed insert is really NOT successful. Any advice on how to handle errors in custom queries in the workflow?

 

0 0

Answer

SELECTED ANSWER
replied on April 20, 2018

Hi Paula,

Simply wrap your queries with a try-catch activity.   If a failure occurs you can process the error in the catch branch.   This activity will also give you tokens for the errors.

2 0

Replies

replied on April 23, 2018

Thank you!  This is working great!

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.