Hello SharePointers,
I am working on my flow and I see that I am unable to Send approval request to a group in MS flow.

Some Background

It seems that flow will only send approval request emails to an individual user. This case won’t work in the long run, we always need to change the flow and remove and add approvers in Microsoft flow.

Is there a way to skip this process and send approvals to group? To Send approval request to a group in MS flow we followed below steps.

Yes, Of course!!! We have a solution for this.

Assigning MS Flow approvals to SharePoint Groups

Currently, Flow doesn’t have the ability to let you assign approval to a group directly. However, we have a workaround to send approvals to a SharePoint Group.

That’s enough about the background. Let us see How to Do it.

How to do it.

TO achieve this functionality we need to follow several steps. These detailed steps are given below.

Step 1: Be ready with your SharePoint site and List where you want to apply an approval process.

Step 2: Create a Microsoft Flow from blank. For this go to flow.microsoft.com from your tenant. Then click on Create from Blank.

Step 3: For the trigger, Select ‘SharePointWhen Item is Created‘ and provide your site URL and List/Library URL.

Approval Flow SharePoint Groups
Approval Flow SharePoint Groups

Step 4: Add ‘Send an HTTP request’ action to the flow. Configure all the API’s properly. _api/web/sitegroups/getbyname(‘SharePoint group name’)/users

Microsoft Flow Assign approvals to SharePoint groups
send HTTP request

Step 5: At this point, we need a variable to store user emails, So Add an action- Initialize variable and configure it like below.

Microsoft Flow approval SharePoint Group
Initialize Variable

Step 6: Now we need to parse a response from the SharePoint Rest API call. Hence we need to add an action from Data Operations- Parse JSON. As a content add Body from Send HTTP request from SharePoint, which is created earlier.

approval flow SharePOint Group
Parse JSON Step

We need to tell flow what schema the response is so that we can use the SharePoint Group response data properly within a flow. Without doing this Flow can’t read values from a bunch of text.

To do this, you can copy below JSON schema and Paste it in Schema section.

To save time , here is full schema you need to add in your flow to get approvers properties like name, email ,etc.

{
    "type": "object",
    "properties": {
        "d": {
            "type": "object",
            "properties": {
                "results": {
                    "type": "array",
                    "items": {
                        "type": "object",
                        "properties": {
                            "__metadata": {
                                "type": "object",
                                "properties": {
                                    "id": {
                                        "type": "string"
                                    },
                                    "uri": {
                                        "type": "string"
                                    },
                                    "type": {
                                        "type": "string"
                                    }
                                }
                            },
                            "Alerts": {
                                "type": "object",
                                "properties": {
                                    "__deferred": {
                                        "type": "object",
                                        "properties": {
                                            "uri": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            },
                            "Groups": {
                                "type": "object",
                                "properties": {
                                    "__deferred": {
                                        "type": "object",
                                        "properties": {
                                            "uri": {
                                                "type": "string"
                                            }
                                        }
                                    }
                                }
                            },
                            "Id": {
                                "type": "integer"
                            },
                            "IsHiddenInUI": {
                                "type": "boolean"
                            },
                            "LoginName": {
                                "type": "string"
                            },
                            "Title": {
                                "type": "string"
                            },
                            "PrincipalType": {
                                "type": "integer"
                            },
                            "Email": {
                                "type": "string"
                            },
                            "IsEmailAuthenticationGuestUser": {
                                "type": "boolean"
                            },
                            "IsShareByEmailGuestUser": {
                                "type": "boolean"
                            },
                            "IsSiteAdmin": {
                                "type": "boolean"
                            },
                            "UserId": {
                                "type": "object",
                                "properties": {
                                    "__metadata": {
                                        "type": "object",
                                        "properties": {
                                            "type": {
                                                "type": "string"
                                            }
                                        }
                                    },
                                    "NameId": {
                                        "type": "string"
                                    },
                                    "NameIdIssuer": {
                                        "type": "string"
                                    }
                                }
                            }
                        },
                        "required": [
                            "__metadata",
                            "Alerts",
                            "Groups",
                            "Id",
                            "IsHiddenInUI",
                            "LoginName",
                            "Title",
                            "PrincipalType",
                            "Email",
                            "IsEmailAuthenticationGuestUser",
                            "IsShareByEmailGuestUser",
                            "IsSiteAdmin",
                            "UserId"
                        ]
                    }
                }
            }
        }
    }
}

The complete action looks like below

Microsoft flow for Office 365
Parse JSON

Step 7: Now we got the data of all users. At this point we are going to retrieve all user’s email addresses into using Apply to each action.

Apply to each in MS Flow

Step 8: Add ‘results’ from Parse JSON action.

Microsoft Flow get Approver from list
iterate results

Step 9: Add new action within Apply to each called –Append to a string variable. Within this, we need to set our initialized Variable VarApproverEmail and set the value Email.

sharepoint rest api get group members
Append variable

Very Important, DO NOT FORGET TO ADD SEMICOLON (;) AFTER EMAIL VALUE.

Step 10: Finally, we are all set to get approvers from SharePoint Group. Let us go ahead and use them into Approval Process. So We need to add an action – Start Approval Process. Fill the required Data and in the “Assigned To” field we need to click on see more and find our variable from ‘Dynamic Content’.

Send Approval Request to SharePoint group in MS Flow

Then Choose ‘VarApproverEmail’ variable.

Microsoft Flow dynamic approval
dynamic approvals.

A complete flow Look like this.

Send microsoft flow send email to sharepoint group
microsoft flow send approval email to sharepoint group

Give a name to flow, save it and Run the FLOW! Bingo! All Done.

Please comment.

8 thoughts on “Solved: Send approval request to a group in MS flow.”

Leave a Reply