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

Question

Question

Counter not adding +1 if it's currently at 1

asked on July 21, 2017

Hi there,

I'm currently building a workflow that needs a database value next to another field (a job number) that raises up by 1 each time a specific type of document is added to the repository. It's basically counting up +1 each time this type of document enters the repository only related to each job number.

It currently works fine when it sits at 0, it will move up to 1. If it's already at 1 and I try to add another document to the repository, it breaks and says "    7/21/2017 3:33:34 PM    Increase Counter Value by 1     Expression: %(QueryData2_CVI)  + 1 Message: Input string was not in a correct format., "

I've included my part of the workflow that is relevant. 

 

 

counter.PNG
counter.PNG (45.87 KB)
0 0

Replies

replied on July 21, 2017

Did you check what the value of %(QueryData2_CVI) is when this happens?

0 0
replied on July 21, 2017

This is the error I get when I try test the query, it does this even when it sits at 0. Which is weird, considering it works at 0 during the workflow. 

type.PNG
type.PNG (8.7 KB)
0 0
replied on July 21, 2017

This is because you're leaving the token in as a test value. You should replace it with an actual number.

2 0
replied on July 21, 2017

Do the Job Number and CVI Number create a unique combination?  Your query says it is selecting all rows but you don't have a for each value loop.  If your query is returning more than 1 value, the way you have it set up it the calculator will only use the first value found every time.

0 0
replied on July 21, 2017

It did not fix my issue but you're right that it should definitely be in a loop anyway.

0 0
replied on July 21, 2017

Can you take the value from the retrieve field activity and go into a token first, then use the tokens to do the data query?

If it can't change the nvarchar string into an integer, try changing it in the token first.

0 0
replied on July 21, 2017

If the query only returns one result, you don't need to run through a For Each loop. But that's why I was asking if you're sure you have the right value. If your query returned multiple value and the first one has a blank CVI, then you might get the error above.

1 0
replied on July 24, 2017

I've now tried it with all different data types and it's still not adding +1. Still same error "    7/24/2017 9:20:55 AM    Increase Counter Value by 1     Expression: %(QueryData2_CVI) + 1 Message: Input string was not in a correct format., "

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

Sign in to reply to this post.