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

Question

Question

Workflow: A for each value activity only sometimes works

asked on November 7, 2014

I have a strange problem that I so far haven’t been able to wrap my head around as to why.

 

I have a workflow a customer been using for awhile that I designed that in it has a multi value field with user’s display names that gets retrieved then a For Each Value activity does a user lookup on that display name and routes a shortcut. However, currently I have some workflows that seem to be skipping the For Each Value activity entirely, but not all of them. I so far cannot determine why. I’ve put a token tracker so we can see what the values are.. here’s what I’ve found.. Where do I go from here?

 

 

In the Retrieve Assigned Approvers Retrieve Field Values activity at the top I retrieve all values of that field, then in the Track Assigned Approvers Track Tokens activity I track that token.. see below:

 

 

In this example there’s only one approver.. However as you can see it skips over the For Each Value (for each assigned approver) entirely with no errors.. below is another screenshot of the EXACT SAME workflow running another instance with no problem. Also just one approver in that field. This is why I’m confused..

 

 

0 0

Answer

SELECTED ANSWER
replied on November 25, 2014

Solution:

 

Before your "For Each Value" activity, add a "Assign Token Values" Create a token with a value of the token you use, but with the function applied for it to return the value count.

Then, add a Routing Decision and put your "For Each Value" activity in one branch. 

If the value count is only 1, have it go to a branch that does not loop through the variable. If the value count is more than 1, then have it go through the branch with the "For Each Value". This should alleviate the issue

0 0
replied on November 28, 2014

Ken, thanks for this suggestion. I had been working with Laserfiche support and your suggestion seems to have done it. It appears that there is a bug with For Each Value activities that have one item to process.

0 0

Replies

replied on June 12, 2015

We've tracked this down to an upgrade issue.

A fix has been released consisting of a whole new installation of Workflow 9.2.1. You can download it from the Support site. The Avante and Rio installations have been updated as well.

The release notes have been updated to reflect this change.

1 0
replied on November 7, 2014

Jeremy,

I also have seen inconsistent results with that activity in the 9.1.0 versions of Workflow. I haven't tried it with 9.1.1 or 9.2, but the workaround I ended up doing was just doing a repeat loop with the repeat iteration as the index for the token you are trying to grab.

0 0
replied on November 25, 2014

I am seeing this exact issue. Any response to this?

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

Sign in to reply to this post.