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

Question

Question

Modify token is not working

asked on July 12, 2018

I have a simple workflow that is designed to look for missing cheque numbers.  It runs through a repeat activity with a Modify Token at the bottom that changes the "Next Number to Look For" token by adding +1 each time it repeats, using this calculation which works when tested:  SUM(%(Cheque Number)+1)

I can't seem to get it to repeat.  The first run through works perfectly, but it seems like the number doesn't get changed... or, rather, it gets changed to something the WF can't recognize.  The repeat ends up with a message "The selected entry could not be found".  It is not modifying the Cheque Number token properly.

What might I be doing wrong?

0 0

Answer

SELECTED ANSWER
replied on July 12, 2018

Ok.  I got it working.  Move your first token activity out of the repeat loop.  I think because the first activity always says the cheque number is 25700 it might be overriding the modify values.

repeatloop.png
repeatloop.png (69.2 KB)
2 0

Replies

replied on July 12, 2018 Show version history

I just ran a simplified workflow, without the Search to see if the token is getting changed properly and it appears it is (the resulting email reflects a cheque number that is 25701 instead of the starting number of 25700, so what else might be stopping the WF from repeating on the next number?  It's not the search parameter, as it does find the next number in a separate test.

0 0
replied on July 12, 2018 Show version history

If I change the Repeat Activity to "Before running contained activities" then the error message happens on the very first run.  So, it's something to do with the "Evaluate the repeat condition".

0 0
replied on July 12, 2018

Okay, back to the cheque number not updating properly!  

I got the Repeat function to work, which proves it's the cheque number not getting modified properly:

0 0
replied on July 12, 2018

Your very last modify token activity show "multi-value" in it.  Is the Cheque number token a multi-value and if so are you appending or replacing?

0 0
replied on July 12, 2018 Show version history

The "Missing Numbers" one, yes, is a multivalue, because the workflow could discover more than one missing and I want the email to show me all the ones it found missing.  Currently, the others are not multivalue, however, I did try combinations where they were.  For instance, the modify one (at the bottom), I explored using the SUM option where it would take the multivalues of Cheque Number (which I entered as 25700 and 1 as the second value) and that seemed to work, but didn't help the repeat options.

OH, and I'm REPLACING.  I did try Appending and telling the next Repeat to use the LAST of the multivalues.  No go.

0 0
replied on July 12, 2018

Just changed it back to multivalue to see if now that I have the repeat function working, will the multivalue and SUM option work.  No:

0 0
replied on July 12, 2018

What does the token calculator show?  Did you verify that the token calculator on the first one shows 25701? 

0 0
replied on July 12, 2018 Show version history

Yes, I did the test and it works fine and the token tracker shows it does as well.

0 0
SELECTED ANSWER
replied on July 12, 2018

Ok.  I got it working.  Move your first token activity out of the repeat loop.  I think because the first activity always says the cheque number is 25700 it might be overriding the modify values.

repeatloop.png
repeatloop.png (69.2 KB)
2 0
replied on July 12, 2018

Yes, Jennifer is right. The token is recreated as 25700 at every iteration through the loop. You need to create it before you go into the Repeat activity.

0 0
replied on July 12, 2018

Success!  It worked!  Thanks for your help!!

So, the problem was two-fold.  When I couldn't get it to Repeat and through all the trying to get anything to work, I moved the first token activity into the Repeat activity, just trying anything.  Then, when I got the Repeat function to work, I didn't think to try moving the first token activity back out!

So, this was very important (configuring the Repeat activity):

And, this is the resulting workflow:

0 0
replied on July 12, 2018

Glad you got it working.

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

Sign in to reply to this post.