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

Question

Question

LF Cloud Multi variables tokens and iterations

asked on February 15, 2024

Hi,

I have workflow that assigns values to tokens from input values sent from a business process. The tokens are multivalued. Examples are day and date reviewed. I also have a blank token created.

I have a For Each Row activity in the workflow. Within the activity I have tokens that get created by applying index The Value at index: For Each Row - Iternation.  



I also append them to the blank token to help me understand.

reference this for outcome snippet below in yellow

I then have a run rule activity that updates a lookup database.
What it is doing now is that lets say I have the following:
day:
02/01/2024
02/02/2024
02/03/2024

Review Date:
02/01/2024

 

It will update the review date to this:
02/01/2024
02/01/2024
02/01/2024


So my thoughts are to have a conditional sequence that compares the iteration of day and review date and make sure they are not empty. This is to stop it from updating empty values in review date with the latest value found, or in this case, only value.

I have set it up the conditional sequence inside the For Each Row to be:

This way it should be looking at day(iteration) and review date(iteration).

This is the step I am currently stuck at.

What I see it doing is selecting the latest value in a multivalued field (review date which only has 1) even though the iteration should not find anything. 

As you can see, it's saying the review date (2) is 2/1/2024 when it should be blank. Same for iteration 3.

Any insight on how to get the iteration to stop pulling the latest and instead return empty?

0 0

Answer

SELECTED ANSWER
replied on February 15, 2024 Show version history

If you specify an index out of range, of indexes that exist, workflow will always return the value in the last index instead. They really need a feature to turn this off and choose to return blank instead because of how many people run into this exact problem.

Your condition is just running into the same problem because your expecting a blank value when you will never get a blank value.

Instead you can use the function Value Count to see how many values there are and use a Repeat loop limited to run only as many times as there are values in the token.

If you right click a token and use the token editor, then in the functions list you will find the function which returns how many values exist in any given multi-value token.

 

Assuming your review date token is always <= the current date token you can use the review date as the key, but otherwise you will need to see which token is smallest array size and always use the smallest token as the key.

1 0
replied on February 15, 2024

Ahhh! So, I'm not the only one who has ran into this issue! Yes, I agree a feature to enable blanks would be great or to point it out. I spent an excessive amount of time trying to figure it out on my own before giving up and posting it because I thought I was doing something wrong. That's on me for not asking earlier.

I will try your recommendation! Thank you, Chad!!
 

0 0

Replies

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

Sign in to reply to this post.