Here's the situation I am in... I've created a list that consolidates items using a data connection in excel. This excel document (stored in SharePoint) requires management approval on a monthly basis. At present I have several managers assigned in the flexi-task action and every month an approval email is sent to them all. I use the 'all must agree' on approval function, once all have approved the document the workflow moves on.
Here's the problem... Once a user submits a list item, the users manager and the current month (i.e. 'July 2016') are added to the list item. On a monthly basis 'Manager A' may have 10 items they need to view on the consolidated document and approve. 'Manager B & C' may have 5 items each... So they need to do the same. 'Manager D' may have zero items to review this month <--- In this instance I do not want that manager to have to approve the document on the month in question, I only want the flexi-task to be assigned to those with items to approve.
Can anybody see any way to do this?
Solved! Go to Solution.
I'm not sure whether I do understand you business case correctly, I'll try to rephrase.
you have an excel that needs to be monthly reviewed by set of managers.
then you have (separate?) list where users submit some items. every item gets assigned a manager somehow (looks like to be 1:1 - every item have assigned just one manager)
and now what/how do you want to approve?
should a manager approve excel doc if he gets assigned at least one item? but do not request an approval from a manager that did not get assigned any task, right?
regardless of how many items a manger got assigned he just approves one single task.
if there are several managers involved then just one task is created and all must approve the task.
no approval tasks are created for single items.
if it is so, then it might be quite easy.
- use query list action to to get all the managers that are assigned to items created within last month. store result into collection variable.
- the most probably, managers will appear several times within resulting collection. so use collection operation action and remove duplicates. => now you have set of all the managers that got assigned at least one list item within last month
- pass this collection to assignee field in flexi task and you should have been done.
You almost got it spot on!! I won't pull apart the details but using a query, collection then removing the duplicates (along with some other logic i.e. filters) worked perfectly.
Thanks for your help!