I'm sure this can be done but I can't figure out how. Certain of our employees must be able to gain access to a local air force base, which means they need an ID badge issued by the base. These badges must be renewed annually. Our HR department tracks these and sends out a reminder each month to those employees whose badge is soon to expire. Each employee must complete a form that contains their personal information, return it to HR, and then HR completes a paper form that the employee takes with him/her to the base to renew the badge.
So what I want to be able to do is have my workflow start in HR. Using a People field that allows for multiple selections, the HR person selects the people to be notified and the month in which their badges are going to expire. Upon submission, a Loop for each action is initiated so that each email address can be extracted. Within the loop the selected people are notified and are each assigned a task, which is to complete their personal info. Completing the task submits the info back to HR, who then review the information and submit. This creates the form that the employee must take to the base, which is attached to an email back to the employee. Once the employee gets the new badge, he/she completes another task in which he/she enters the new expiration date of the badge and HR is notified.
It seemed fairly straightforward when designing it, and it works fine as long as only one employee is notified. But that won't be the case in reality. The problem is that a task in a loop must be completed before it moves on. In this case, the task won't be assigned to the second employee until the first employee completes it, and so on down the line. What I need is for each employee to be notified at the same time, and to be able to complete the task independently of the others. Each month X number of employees will be notified, and so X number of tasks must be assigned.
I have a feeling there's a fairly easy way to do this, but I can't come up with it. Any ideas?
Solved! Go to Solution.
Hi @DavidAD ,
Great idea for automating.
I would solve your initial problem by splitting this into two workflows. The first workflow generates the collection of users/email addresses.
The second is a component workflow that assigns the task to the individual user. This component workflow can also do the HR form processing and continue with the employee updating the expiry once the badge is renewed. The component workflow would have start variables of employee email and any other variables that you would like to reference in the task.
So in the loop action in the first workflow it uses the 'Call a workflow' action to start the component workflow and pass through the email address as a parameter. Use the option to run both workflows concurrently so that the loop continues on to start the next component workflow.
So that should solve your first problem.
Looking at the concept I think you could take the automation further by using a list to store all the badge details (eg employee email, issue date, expiry date, etc).
This list could be a sharepoint online list, sql db, (any of the NWC connectors which can query a list and update an item)
The idea is that you run a scheduled NWC workflow to loop through the list say once per week, find all employees whose badge is about to expire, start the component workflow with email and list reference ID. The component workflow can do the business logic you explained below. Then by having the list reference ID the component workflow could update the list item with the new expiry and issue dates.
Hope this helps @DavidAD
Thanks, @Gavin-Adams! Your reply was prompt and thorough. It was also exactly what I needed. I had wondered about using a component workflow for this, but I had never used one before and wasn't sure exactly how they work. Now I know. Thanks!
David how does the component workflow get the information including the email addresses through the first workflow to use in the assign a task action?