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

Question

Question

How to remove a user name from a multivalve field

asked on June 23, 2016

Hi guys,

I've got a "Document Review" business process (BP).  The document owner selects one or more reviewers in a multivalue "Reviewers" field in the document template.  The first BP step uses the reviewer names to look up AD and email the reviewers notification of the review requirement.  The BP Participants "Reviewer" role is updated with the names of the reviewers for due date notifications, then I clear the "Reviewers" field so that when each reviewer completes their review, they just need to reenter their name in the "Reviewers" (drop-down) field which the workflow is monitoring until the original count of entries in the Reviewers field is matched and the workflow progresses to the next step.

It works well as far as the workflow is concerned, however the issue then arises if the document owner wants to check progress in terms of who has or hasn't completed their review.  As I've cleared the "Reviewers" field, the original names aren't listed in the metadata.  So I've created an "Awaiting Reviewers" multivalue field which is populated from the "Reviewers" field before it is cleared.  (I'm thinking there's probably a much easier way to do this so please let me know if I'm getting this wrong.)

Where I'm coming unstuck is that when a user completes their review and signifies this by adding their name back into the "Reviewers" field, I want to automatically remove that name from the "Awaiting Reviewers" field.  I've tried juggling various multivalue tokens but can't work out how to do it.  I have an initial "Reviewers List" token at the beginning of the workflow which contains all the original reviewer names, and then I have a "Completed Review" token which contains the name of the user who puts their name in the "Reviewers" field when they finish their review.  If I could work out how to remove the matching name in the "Completed Review" token from the "Reviewers List" token, I could then use the remaining name(s) in the "Reviewers List" to replace the values in the "Awaiting Reviewers" field ... !

Sorry if this has given you a headache!  :o)

Any suggestions?

Thanks,

Mike

0 0

Answer

SELECTED ANSWER
replied on June 27, 2016

You can't remove a field value in the middle, you have to set all the values back. So Chris' way is a good one. You could also run the Remove function on the token with the appropriate values, then use Assign Field Values to set the remaining users back.

1 0

Replies

replied on June 28, 2016 Show version history

In case anyone is interested, this is how I got the process to work:

 

The "Update Current Reviewer List" token modifies the "Reviewer List" token, removing the matching value from "Retrieve Current Reviewer field entries".  The subsequent "Update Current Awaiting Reviewers" activity replaces the "Awaiting Reviewers" field value(s) with the contents from the "Reviewer List" token, effectively removing the completed reviewer from the Awaiting Reviewers field.

2 0
replied on June 24, 2016

Can you just do a compare of the two tokens?  Do a For Each Value one of the tokens.  Then a routing decision inside where the condition is "is the For Each Value current value contained in the token you are comparing to".  The other side would be not contained.  I am doing something like you but I am comparing a result list from a DB with a multivalue token.  Should be pretty much the same thing.  In mine, if the value is not found in my token I know that value should not be in the DB so I delete it:  

I am not sure if you can delete a specific value from a multivalue token.  I seem to remember maybe multi value tokens have index values but not sure of the syntax.  You could just create a new token and populate it based on the routing decision in the For Each loop.

1 0
replied on June 26, 2016

Thanks Chris, I've looked at the compare/matching function as well, but it keeps coming back to how to remove the user from the original token that is returned in the match against the second token.  Somebody is bound to have done this already so I'll keep searching and see if I can find anything on it.

0 0
SELECTED ANSWER
replied on June 27, 2016

You can't remove a field value in the middle, you have to set all the values back. So Chris' way is a good one. You could also run the Remove function on the token with the appropriate values, then use Assign Field Values to set the remaining users back.

1 0
replied on June 27, 2016

Thanks Miruna.

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

Sign in to reply to this post.