Send several approvals request at the same time


Badge +8

So I'm building a notification system, first I fetch items from the list and store it in a collection. Then I use foreach action to return each item in the collection and send approval request for each item in the list.

The problem is when it comes to approval request action, it'll wait until the first item is approved then it will send the second approval.

I want it to send all the request approvals at the same time

Capture.PNG

Is there a way I can achieve what I want without having to approve/reject the first item to send the rest of items approval request?


11 replies

Badge +8

I can't use that. As you can see, I'm using a foreach action above. It will still wait for the first approval's request to finish to send the next one.

Badge +5

Hi Shaikha,

I think one approach might be to use 'Start workflow' action inside the loop and create your approval task inside that second workflow.

Barry

Badge +8

The thing is, I don't know how many items that needs approval. It depends on the records that query list action returns.

Badge +5

Of course...and this is the reason you can't use parallel actions. But if you use Start Workflow action inside your for each loop your workflow will not wait for each task to complete before iterating to the next item in the collection. The number of workflows started will equal the number of items in your collection.

Badge +3

Save query list result in collection variable and use this variable in Request approval action ,

83747_pastedImage_0.png

Badge +5

This might work if every task recipient receives the same the same task description / notification. But if there is some contextual information being retrieved in the Query List action for each item in the collection then that could not be accommodated with a single Request Approval action assigned to a multi-user Approver list.

Badge +8

Isn't it going to create an infinite workflow?

Badge +5

No, that won't happen.

What I am suggesting is to start (multiple instances of) a separate second workflow, not another instance of the one that is already running - let's call that one your parent workflow. So if your collection contains 10 items, 10 approval task workflows (child workflows) will be started.

Your second workflow could be a site workflow, so not attached to any list. When designing that workflow, specify any variables which need to be passed in to provide the context you need, for example the list item ID for the item which is to be approved, the task assignee etc. If you set these to show on start form they can be populated in your start workflow action - of course the workflow start form will never be seen because it is not being started manually.

So if you create a workflow with parameters like the following:

WorkflowVariables.png

When you use the Start Workflow action and select your second workflow you can pass in any variables you need...whatever it was you got from your collection and query list actions e.g.

StartWorkflow.png

Your Update Item action could move into the second workflow too.

Badge +1

I agree with Barry Cairns​ that this is the preferred approach. It will work very well.

Badge +16

‌ did you try the approach above?

Badge +1

Can anyone provide the screenshots from the above?

Reply