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

Discussion

Discussion

Frustrated with Group Fields in workflow

posted on January 13

Hello Everyone,

I have spent the better part of the day dealing with updating and managing Group Fields via Workflow and I'm exhausted. I already have one workflow that can change a value with a script based on an answer post I found. Not the best way but it works. the issue today was the fact that A user can add a group field and because I can't use default values in these (tried and anytime workflow added one values, it would mess up the order and just made it worse, so I apply values for all fields myself in a workflow to ensure the groups are correct) a user will leave some values blank. If you have blank values in a group field, the SDK script that grabs the collection fails with an error. 

I found this post, https://answers.laserfiche.com/questions/127695/workflow-assign-field-value-add-null-fields-to-field-group#127740 and Miruna suggests rebuilding multivalue tokens and then applying the all once to get the groups to be correct. Well, most of the day was dedicated to building a workflow to identify when there are blank values and then trying to add default values to the correct location without changing the existing values. 

Anyway, I guess this is turning into a feature request. We NEED a native Workflow activity that can interact with these values based on their index locations. Something that I could easily append values to certain groups based on the value of an index number. 

0 0
replied on January 15

Since I was the one who posted this, I feel that I should post the solution. Here is the group field I'm working with. This is used for the approval (or review) of a document. 

A Form is filled out and I use Workflow to fill in the values when the form hits the repository. My users also can add a reviewer later. When they do, I have instructed them to fill in the reviewer decision and the decision date. That does not always happen. So I build this piece into the daily workflow that runs on these documents and notifies the users that they need to review the document. 

 

The first thing I do is retrieve all 3 values from the group field. Then use a For Each Value on the reviewer decision multivalue token. if someone left this blank, there will be a null value, and the condition is looking for that. When it's found, I modify a token I use as an indicator. The next condition is looking at that indicator to see if it is on. When it is, I count the number of reviewers and the number of reviewer decisions. Then another For Each Value on the reviewers. I create an empty multi-value token for the 3 values in my group. I set the condition to compare the number of decisions to the iteration of the for Each Value. That way the first values that are valid are filled into the New token. Once that's done, the other branch runs on the remaining iterations and fills in the Reviewer name and my default values I want. The last step is to replace the values on the document with my new values. 

This process seems like more work than needed to accomplish the goal of ensuring there are no blanks in a group field and the only reason I need there to be no blanks is that the SDK script I use to update a value crashes when there are blanks. If there was a native activity to update group fields that wouldn't crash if there was a blank, then I wouldn't need this enhancement to my workflow to correct the blank.  

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

Sign in to reply to this post.