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

Question

Question

Update Column Values in SQL Update not working

asked on June 24, 2022 Show version history

TGIF!!  Using Workflow 10.4.1

I am reallly missing something here with the UPDATE SQL workflow tool.  I was able to figure out the INSERT WF tool, however The UPDATE is beating me up right now LOL.  I want to update rows with Invoice and Requisition values from a Forms table.  This is what I have: 

 

 

 

 

This is my first time using the UPDATE WF tool.  I have a hole in my thought process that I can't break through and fill.  Any help would be greatly appreciated.  

Thanks! Sue

 

0 0

Answer

SELECTED ANSWER
replied on June 27, 2022

Hi Matthew,

Met with vendor and I needed the For each Entry since I was getting the values from a form lookup :)  Learn something new everyday!! 

Thanks for responding.  Hope everyone had a great weekend and has a great week!

1 0

Replies

replied on June 24, 2022 Show version history

I think your problem is the tokens you are using in the Update Data Activity.

You are referring to the tokens from the Retrieve Business Process Variables activity, when you should be using the tokens from the For Each Row activity.

Let's say your Part_Recvd_Details\Invoice field has three values, 1, 2, and 3.

The token you are referring to from the Retrieve Business Process Variables activity is going to contain all three values, so it's trying to match against all three values in the database table.

But if you refer to the For Each Row activity's tokens - then it will only use the value from the field for the current interation (the current row).  So in that case, it would only have the 1, or the 2, or the 3 in this example.

Does that make sense?

 

P.S. You should consider post your question to make it a question instead of a discussion so that you can mark it as answered once you have a resolution.

1 0
replied on June 24, 2022

Thanks for responding Matthew and for the PS.  That was an easy fix :)

Not sure if it makes complete sense yet...  sorry.  So I do understand now that the Rows to Update needs a unique identifier, which it now has.  The ADMINdbID is a  primary key for the table.  Is the Rows to Update like the where statement values.

I ran it and the tokens are showing the workflow search results.  Just not updating the table...

0 0
replied on June 24, 2022

You probably need to use the For Each Row tokens in the New Values section as well.

If you were writing an UPDATE statement, then the "Rows to Update" would be equivelant to your WHERE statement, and the "New Values" would be equivelant to your SET statement.

0 0
SELECTED ANSWER
replied on June 27, 2022

Hi Matthew,

Met with vendor and I needed the For each Entry since I was getting the values from a form lookup :)  Learn something new everyday!! 

Thanks for responding.  Hope everyone had a great weekend and has a great week!

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

Sign in to reply to this post.