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

Question

Question

Leading zero not working with Ver. 11

asked on February 19

 

 

Just upgraded to Workflow Designer Version 11.0.2306.898. A portion of a workflow that has worked for years no longer works. If the revision token is 0, it assigned the format as 00 (had to add that because Rev. 0 was giving me a hard time in the past.) Then, format all revision values as two digits.

The issue is that it is no longer formatting revision with two digits. What changed?

0 0

Answer

SELECTED ANSWER
replied on February 19

Hm, that's weird. I can reproduce it when the value is 0, but not when it's another number. Likely because the 0 is the format specifier and the value. We'll look into it some more.

Use D2 instead of "00" for formatting. It has the same outcome, but does not seem to get confused when the value is "0".

2 0

Replies

replied on February 19

Is this a problem only when you input "0" for the revision or for all numbers?  If it is only for the zero, consider using a conditional decision rather than a conditional sequence.

 

This prevents the "2-Digit Formatting of Revision" from running if you enter "0" for the revision.  It is possible depending upon how you set up your tokens for the "2-Digit Formatting of Revision" activity to overwrite something your "Assign Rev. 00" activity does.  I found that no matter how I set things up, a "0" always ended up formatting as "0" when I ran the workflow like yours is set up.  I'm not really sure why because once the token is written to "00", it should stay that way through the formatting.  If I set it up as above with a conditional decision, "0" always formats as "00":

If your issue is with all numbers, I couldn't get this to break but I'm on version 12 and it could have been something fixed in version 12.

0 0
replied on February 19

Made the suggested changes.




My issue is only with Rev. 0.

 

0 0
replied on February 19

If you remove the "2-Digit Formatting of Revision 0" activity from the workflow, it should work.  But Miruna's suggestion is better.  It completely simplifies everything:

 

0 0
replied on February 19

This bothered me a bit so I redid the workflow.  This should simplify things:

The RIGHT function is set up in the Token Calculator Activity:

All this does is pad two Zeros before whatever you input is and then take the Right two digits as the output.  So, "0" becomes "000" ("00" & "0") and then the right two digits is "00".  This should work for any number as well as an empty string and you won't need a conditional statement.

0 0
replied on February 19

One more note... I shouldn't have named the last activity "Format Input Token".  This just applies the value from the calculation to the output token of my workflow.  It should be named something like "Set Output Token" or in your case "Set Revision Token".  The Token Calculator Activity generates a new token and can't write data into an existing token (as far as I know).  So, I just add an "Assign Token Values" activity to write the calculated value back into any token you want:

0 0
replied on February 19

Thanks Peter and Miruna! I finally got Rev. 00!!!

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

Sign in to reply to this post.