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

Question

Question

Workflow - Iterate through multi-value field and replace blank fields with a 0

asked on January 26, 2023

Hello,

We have a customer who uses a multi-value field group to group together GL codes and the dollar amount assigned to each GL code. They have requested that at some point in the process, we look at the 'GL Amount' field and replace blank values with a 0. The default value for this field is already 0, but for some reason they still periodically end up with some that have a GL code filled out, but the GL amount is 0. Example below:

Is there a way for workflow to iterate through each GL Amount and if the field is empty, assign 0 to it without messing anything up with the other values?

0 0

Replies

replied on January 26, 2023

Yes this is possible!

 

The trick is using a For Each Value and using a conditional decision to check if the Current Value is empty or not.

 

The part that does get tricky is to iterate through a multivalue field and replace the values, we will need to clear out all the values after retrieving them and add them back one at a time.

 

So my workflow does the following

  1. Retrieve Multi Value Field Group
  2. Clear Multi Value field group from the template
  3. For Each Value from Step 1:
    1. Conditional to Check For Each Value_ Current Value = empty
    2. Check if this is the first iteration or subsequent iterations. 
      1. If First iteration then OVERWRITE values.
      2. If Subsequent then APPEND values
  4. If the Current Value is blank, it assigns the values back with GL Amount being 0
  5. If the Current Value is NOT blank, then it assigns all the values back as they were. 

 

I have added some screenshots and the workflow(change GLAmountTest.txt to GLAmountTest.wfi) for you to take a look at. If you have any questions please let me know!

 

Initial Field Values.PNG
AfterWorkflow.PNG
TheWorkflow.PNG
TheWorkflow.PNG (50.82 KB)
GLAmountTest.txt (32.42 KB)
2 0
replied on January 26, 2023 Show version history

Hi Jacob,

 

If you search by field (rather than by template) it's a literal search. So perform a search where GL Amount field is blank, then use a for each entry activity in workflow to update the value to 0.

 

I'm not 100% sure however how this will work with field groups, you might have to play around with the assign field value logic, to get this working.

 

Hope this helps point you in the right direction!

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

Sign in to reply to this post.