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

Question

Question

Custom query track tokens

asked on September 26, 2018

I have a workflow with a custom query to perform a delete query.  I have a Track tokens activity directly afterwards.  However, the token always returns a value of 0.

Why am I always getting a 0 for the token value?  Am I not using the proper activities?

LFWorkflow1.png
LFWorkflow2.png
LFWorkflow1.png (38.58 KB)
LFWorkflow2.png (29.78 KB)
0 0

Answer

SELECTED ANSWER
replied on September 26, 2018

DELETE statements in SQL don't return anything. You can try adding an output clause to your delete statement in order to return the rows that were delete, and that might give Workflow something to put into a token.

DELETE FROM dbo.aacustom_category OUTPUT DELETED.* WHERE category = ?

 

1 0

Replies

replied on September 27, 2018

I also had the same issue with using the Update Data activity.  I converted it to a Custom Query and it is working with the Output Clause.

 

UPDATE dbo.aacustom_category SET category = ? OUTPUT DELETED.*, INSERTED.* WHERE category = ?

1 0
replied on September 27, 2018

Devin - Thank you for the assistance.  I added the OUTPUT DELTED.* and got the token setting as I wanted.

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

Sign in to reply to this post.