Forum Discussion
Email a SharePoint Group from Flow?
_api/Web/SiteGroups/GetById(4)/users?$select=Title,Email
once you have that you can use the Outlook send mail action to send an email.
Terry Hagan If I use this, where does it store the information for me to be able use it later?
- Terry HaganOct 04, 2018Iron Contributor
It doesn't store anything, the information, user title and email, is already stored in the SharePoint Group for you to use when you retrieve it.
- Brent EllisOct 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"
]
}
}
}
}
}
}- wendie1970Sep 10, 2021Copper ContributorYou, sir, are a sanity saver!! I spent an afternoon trying to get this schema! Thank you!!
- Jennie SheridanJun 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"}}}}}}}}}}}}}} - cheickalimdialloMar 28, 2019Copper ContributorThanks a lot !