In Microsoft flow there is no built in action to add a user to a SharePoint group. One way to achieve this is to use the “Send HTTP request to SharePoint”
in this action you need to
- Set the URL of the Site
- Set method to “POST”
- URI set to “_api/web/sitegroups({GROUPID})/users”, example: _api/web/sitegroups(10)/users
- Add header with key=”accept” and value = “application/json;odata.metadata=none”
- Add header with key =”content-type” and value = “application/json”
- Set the Body to be {‘LoginName’:’i:0#.f|membership|[EMAIL ADDRESS]’}, example: {‘LoginName’:’i:0#.f|membership|john.doe@domain.onmicrosoft.com’}
It would look like this
This is tested with a SharePoint online connection but assume might work with on premise SharePoint as well.