“Is there a way to see who already approved/rejected the task without waiting for everyone using the multi-approval Power Automate task?”
When you create a task using the Approvals functionality, you’ve got two options. You can wait for the first response or for everyone to respond before the flow continues. It’s quite simple in the first situation – user responds, you store the outcome; with no response you send a reminder to everyone.
Using the second option makes the solution a bit more complicated. There’s no information during the approval task, the flow won’t tell you who already approved and who didn’t, you have to wait for everyone to complete the task to get their responses. That’s not an ideal solution. How can you track the progress of such task? Or how do you send reminders only to users who didn’t complete the task yet?
Note: this solution requires Power Automate premium license.
Get the task information from Dataverse tables
Since there’s no action that’d give you regular updates, you must build the functionality by yourself. That means going to the underlying Dataverse tables related to the Approvals (hence the requirement of the Power Automate premium license).
As explained in the previous article on dynamic number of approvals, there’re two tables relevant for this solution. Approvals with the whole tasks and Approval Responses with responses to these tasks. One approval task assigned to 5 users will have 1 row in Approvals table and up to 5 rows in the Approval Responses table (1 row per response).
Therefore, a flow processing all the responses in real time should be triggered by addition of a new row to the Approval Responses table.
Get the task
Unfortunately, this table doesn’t contain much information about the task itself. The task information is in the Approvals table connected with the Approval Responses using id. To get the actual task continue with the ‘Get a row by ID’ action.
triggerOutputs()?['body/msdyn_flow_approvalresponseidx_approvalid']
Get also the response comments
But that’s not all. You’ve got most of the response information, but it’s missing for example the response comments that’s important. That means you’ll have to get the response again, this time asking it also for the comments (among the other columns).
triggerOutputs()?['body/msdyn_flow_approvalresponseid']
msdyn_flow_approvalresponseidx_approvalid,createdon,_ownerid_value,msdyn_flow_approvalresponse_response,msdyn_flow_approvalresponse_comments
And to make it another bit more complicated, the approver information is also a bit limited. While you get the id of the user who approved this multi-user task, it’s not the standard user profile id you could use in the Power Automate ‘Get user profile’ action. It’s an id in another Dataverse table – Users.
…and the approver
To get also the user information add another ‘Get a row by ID’ to search for the user information. I’m getting only the email address and full name on the screenshot below as that’s all I need. If you need more than that you can select additional columns from the JSON…
outputs('Get_a_row_by_ID_-_get_response_data')?['body/_ownerid_value']
internalemailaddress,fullname
…or get the standard user profile using the email address.
outputs('Get_a_row_by_ID_-_get_response_user_information')?['body/internalemailaddress']
At this point you’ve got all the information you might need about the task response.
That’s nice, but how do I use it in a flow?
Connect the tasks with a specific request
Even though you have all the response information, it’s missing one important part – what is the task actually approving? Approvals are a standalone application and as such it doesn’t have it’s own connection to a request. The only connection is the one you create – through the task title or using the link to item.
Link to the item
If you’re approving requests in SharePoint, you can use the link to item as it’ll contain all the required information. The link will contain the SP site, list id, and id of the item, just waiting to be extracted (e.g. with the split(…) expressions).
Site: split(outputs('Get_a_row_by_ID_-_get_related_task')?['body/msdyn_flow_approval_itemlink'],'_layouts')[0]
ListId: decodeUriComponent(split(split(outputs('Get_a_row_by_ID_-_get_related_task')?['body/msdyn_flow_approval_itemlink'],'ListId=')[1],'&')[0])
ID: split(split(outputs('Get_a_row_by_ID_-_get_related_task')?['body/msdyn_flow_approval_itemlink'],'ID=')[1],'&')[0]
You can do such extraction on every link containing all the necessary information.
Connection using task Title
The other option is to connect the task using the task title. In general, the task title should always contain two things – unique ID of the request and name of the solution. If it’s e.g. an onboarding process, it might look:
123 | Onboarding | HR approval for Tom Riha
It’s again something you can get from the task and split into different pieces. Create a configuration list where you connect the solution name with the source of the request, extract the name from the title, and use it to access the request through the ID.
Use it to update the request
Now, when you’ve got the response and the related request, you can put it all together. You can update the approval history after each task response, let it be history overview table or a separate SP list.
Or you can use it to send reminders – just keep all approvers in one column, update those who approved in another one, and send an email to the difference.
Summary
Even though Power Automate won’t tell you who already approved their task in multi-user approval scenarios, you can build the functionality by yourself. Get directly in the Dataverse tables related to the approval tasks, extract all the required information, and connect it with the request. After that it’s up to you what you want to do with this information, let it be real-time approval history, reminders, task recreation, or something else.
Hi Tom, thanks for this blog! Really interesting.
With regards to your opening para: ‘You can wait for the first response or for everyone to respond before the flow continues. It’s quite simple in the first situation – user responds, you store the outcome; with no response you send a reminder to everyone’ – I am wondering with the first situation of first person to respond you send a reminder, how do you use PA to send a reminder if there is no response? Is there an action for this or do you need to set something up manually? Thanks so much!
Hello CB,
there’s no action for reminders, I use a separate flow as explained here: https://tomriha.com/how-to-build-basic-reminder-flow-using-power-automate-and-sharepoint/ often combined with this solution to send just one email per user: https://tomriha.com/send-one-email-per-user-with-multiple-sharepoint-items-in-power-automate/