Workflow: Initiate Approvals Based on Lookup List


Badge +7

Hi All,

I have a lookup list for software, eg:

Item                   Approver

Word                  

Excel               

Visio                    John Smith

Photoshop           Micheal Wiley

This lookup is used in a Nintex form. Users can select multiple options from the list above. The result gets passed to a Single Line of text (but i could change that), with comma delimited values.

How do I setup the resulting workflow to parse through the selected options on the form, and initiate the appropriate approvals. Let's say for instance all 4 were requested, the workflow should determine that Word and Excel are ok to be installed because they have no listed approver, while Visio requires an approval from John and Photoshop requires an approval from Micheal. I'd rather not have 4 workflows spawned off from the original but handle it some other way, such as a Loop. thanks


21 replies

Badge +16

Hi!

Not at my computer right now to be able to add any screenshots but will do later if you need.  i think  you need to:

  1. use regular expression, take the single line of text field and look for "," and split into a collection variable (this will give you all the choices selected in a collection)
  2. use a for each action to loop through the collection above
  3. inside the for each lookup the approver for that item (i.e. word, visio etc) using query list and store approver in a variable
  4. have a run if (approver variable is not empty) and inside the run if assign your flexi task to gain approval assigning to the approval variable

Does that make sense?  I can add some screenshots tomorrow (or perhaps ‌, ‌, ‌ might be online to do that)?

Userlevel 3
Badge +9

If you were storing the names in individual fields rather than a single string it should be fairly easy.  You could have a single workflow with a RunIf action to check if the string for each application was populated with an approver.  It's populated, then it would create an approval task.  Here is a mock up. 

200793_pastedImage_1.png

If you you foresee more applications being added to your process, and you want to do the loop as you suggested, you could use the single string like you mentioned, but you'd need to add in the name of the Application before each name.  Then in your workflow you could use a RegEx to parse the string into a collection, then run through the collection and create your approval tasks depending on if the application had a name or not. 

Badge +7

Dear,

1-Create three collections: one for the selected options, one for the "to be installed" ones and one for the "requiring approval" ones. (var_Coll_Selected, var_Coll_ToBeIns, var_Coll_ForApproval)

2-Use a regular expression to split the value based on the delimiter (comma here) then store the result in a var_Coll_Selected.

3-Loop the var_Coll_Selected, for each item inside, query the "lookup list" where "Item(lookup list)" is equal to the item in the collection. then store the "Approval(lookup list)" in a variable called var_Approval.

4-Check var_Approval, if empty, append the iterated item to the var_Coll_ToBeIns collection, otherwise append it to the var_Coll_ForApproval.

5-Now outside the "For loop", you have 2 collections of items that you can deal with.

Cheers... happy.png

Badge +8

I don't think this solution is very scalable. There are probably more than 4 applications silly.png

Badge +8

Hi ‌,

The challenges you face are the details, like:

- When someone rejects an application, does this mean all other applications are rejected?

- What to do when someone does not respond? Are all other application requests postponed?

- Is there a deadline before all applications have to be approved?

- Avaiable applications are maintained in a separate list. What to do with obsolite applications?

You probably also want all approvals requests sent at the same time (parallel, not serial), hence a loop with a flexi-task does not work. This will be your main workflow challenge imo. You mentioned you do not want to spawn of other workflows, but what I expect you want cannot be done in one workflow (and one list).

Please reconsider that your solution should be a one-workflow only and investigate time in the details first.

Cheers,

Rick

Userlevel 3
Badge +9

I listed 2 solutions.  The first solution is based on his specific question, which only listed 4 options.  The 2nd solution is scaleable and would handle any number of applications.  Appreciate the constructive criticism though.  

Badge +7

Cassy this is fantastic, just what i needed to get my brain moving.

thanks!

Badge +7

Thank you both. Definitely would need the second option. I'll get this into a proof of concept and see if i run into any issues.

Badge +7

Cheers Rick, your points are all well taken. I agree that parallel would make more sense logically and had thought of the same idea, but then backtracked when I realized I would need to define the number of parallel branches beforehand, and this would presumably vary based on the scenario, so that seemed to put parallel out as option.

Badge +7

Thanks Philip,

I have a followup question. The var_Coll_ToBeIns is straightforward, but the premise of var_Coll_ForApproval relies on all those approvals going to the same person, does it not? Using your method, wouldn't you need a collection for each possible Approver? 

eg.

var_Coll_For_Approval_JohnSmith

var_Coll_For_Approval_MichealWiley

etc.

Badge +7

Dear, 

Yes happy.png

Userlevel 5
Badge +14

parallel need not necessarily mean 'run parallel action'.

see this discussion  

so in your scenario you could create one list workflow that would start on item submit.

then you could create a site workflow, with two input parameters - application name and approver name (if there are not any other approval specifics for single applications)

list workflow would loop through all the selected application that needs approval and for each it would start separate instance of approval site workflow.

Badge +7

Oh I see. Thanks Marian!

Badge +8

Hi Brendan,

I meant the first solution (pictures) indeed. Good thing you made that one more clear. Sorry if I created any confusion.

Cheers,

Rick

Badge +8

Another possible form of parallelism is:

Add a Nintex workflow on the Task list and use the 'Create item' action (in a loop) to add an item in the task list (aka create a task). Create business logic in the workflow on the tasklist to investigate if all tasks for a specific topic are processed (and act accordingly on it).

Userlevel 5
Badge +14

I wouldn't go this way.

workflows on task list could be source of hardly identifiable problems.

Badge +8

I have no bad experience with it (on the contrary even), but there is always a first time for everything silly.png

Userlevel 5
Badge +14

wait a bit, they are going to happen shortly after you deliver important project happy.png

Badge +8

Hahahaha

Userlevel 5
Badge +12

Timing issues are tricky devils, which is the problem when it comes to tasks.  Things become locked if you attempt access at the wrong time.   Timing issues are also pretty hard to replicate.  So they are definitely the type of thing that sneak up on you and bite you.  Although depending on your WF, it could mitigate the risk simply based on its design, but its too much to get into here.

Userlevel 6
Badge +12

Hello ‌ - 

Looks like you got a lot of valuable comments and different approaches from the community!

Did any of these answer your question? If so, please mark the correct answer so that others can quickly jump to how you solved your issue.

Thanks

Reply