Forum Discussion
Brent Ellis
Aug 22, 2017Silver Contributor
Email a SharePoint Group from Flow?
Is there a way to email a SharePoint Group from a Flow? (not an O365 Group, not an AD group, but a legit SharePoint group) Or do I have to define and maintain an actual Distribution Group for flo...
Brent Ellis
Oct 03, 2018Silver Contributor
Here is what I do for this (I am using this pattern for sending emails and assigning Flow tasks):
1) Initialize a variable of type string called "SendEmailTo"
2) Use the SharePoint HTTP call (i try to do everything using the Group ID)
3) Use the Parse Json action against the body of the SharePoint Http using the schema in the attached file
4) Do an Apply to Each on the body of the Parse Json action, and append the email (IMPORTANT with a semi colon) to your variable. This is will built you a string of email addresses that can be used in the send email action.
SCHEMA FOR PARSE JSON ACTION
{
"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": "number"
},
"IsHiddenInUI": {
"type": "boolean"
},
"LoginName": {
"type": "string"
},
"Title": {
"type": "string"
},
"PrincipalType": {
"type": "number"
},
"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"
]
}
}
}
}
}
}
Jennie Sheridan
Jun 10, 2019Brass Contributor
I also didn't get this to run with the provided JSON.
I had a successful run after I changed it to this:
{
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"d": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"results": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"items": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"id": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"uri": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"Alerts": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"__deferred": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"uri": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
},
"Groups": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"__deferred": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"uri": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
},
"Id": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"IsHiddenInUI": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"LoginName": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Title": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"PrincipalType": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"Email": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"IsEmailAuthenticationGuestUser": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"IsShareByEmailGuestUser": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"IsSiteAdmin": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"UserId": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"__metadata": {
"type": "object",
"properties": {
"type": {
"type": "string"
},
"properties": {
"type": "object",
"properties": {
"type": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
},
"NameId": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
},
"NameIdIssuer": {
"type": "object",
"properties": {
"type": {
"type": "string"
}
}
}
}
}
}
}
}
},
"required": {
"type": "array",
"items": {
"type": "string"
}
}
}
}
}
}
}
}
}
}
}
}
}
}