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

Question

Question

Workflow - Multi value field groups - Condition based on field within each group

asked on January 5, 2024 Show version history

Hello,

I have a customer with a process involving assigning GL codes to invoices. The GL code is a multi value field, in a group with another multi-value field named Unit Number. These invoices sit in a folder and wait for a manager to assign GL codes to them, at which point the invoice moves to a different folder.

What I'm trying to do is come up with a way for the invoice to remain in the manager's folder IF the manager assigns a GL code that pertains to vehicles (easy - we populate a GL description with dynamic fields and if it contains the word 'vehicle,' we know we're talking about a relevant GL code) AND the manager DOES NOT provide a value in the Unit Number field within that same multi-value field group.

This works fine if there's only 1 multi-value group. However, if there are multiple multi-value field groups that contain a 'vehicle' GL code, I'm having trouble getting Workflow to determine that all of those multi-value field groups need a value for the Unit Number. Screenshot of my workflow below:

That conditional sequence will prepend something to the document name to indicate it needs a value in the Unit Number field, and then end the workflow. The same workflow will start again on this document when it's changed again, and if we have a Unit Number for each 'vehicle' GL code, the idea is that the conditional sequence would not run and the workflow would proceed as normal from there.

So I'm basically looking to iterate through the multi-value field groups and somehow determine if each one with a 'vehicle' GL code also has a Unit Number for that group. Is there a good way to do that? Wondering if the best I can do is loop through the GL code fields to get a count of how many contain the word 'vehicle,' and then getting a count of how many Unit Number fields I have, and if the count of GL codes is more than the count of Unit Number fields, then that would indicate that this action needs to be taken.

0 0

Replies

replied on January 5, 2024

There are probably multiple ways to do it, but something like this might work.

This simple workflow takes two multi-value tokens.  In this example:

If I want to get the instances where they are equal to 1 and One (the 1st, 4th, and 6th positions), I can do a workflow like this:

We loop first through %(Token 1) and then within that we loop through %(Token 2).

Within the inner loop, we do a condition to make sure the iteration of the first loop matches the iteration of the second loop, which makes sure we're looking at the same position in both tokens (1st position in both, 2nd position in both, etc.) 

We also do our condition check for the expected values (in this case, that the current value of the first loop is 1 and the current value of the second loop is One).  The Condition looks like this:

Finally, for this example, the Track Tokens activity was just a simple way to confirm what was happening.  When the conditions are all true, the Track Tokens activity tracks the current interation of both loops.

The condition evaluated true (values are 1 and One) for positions 1, 4, and 6 - which was the value we expected.

2 0
replied on January 5, 2024

I would get a count on the GL Codes multi-value token. Then on the Unit Number one, i would remove blanks and then get a count. Compare the 2. If they're equal, then you're all good, everybody has their unit number. If they're not, then you can do further processing looping through the descriptions to see which one is a vehicle and whatnot. That way you only shuffle through everything when they're not fully filled out.

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

Sign in to reply to this post.