cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
laura_marsden
Frequent Visitor

Use flow to send email notification to the list group members when news post published

Use flow to send email notification to the list group members when news post published

I've been looking all over for a solution and way to do this and have found many different options, some which date back to 2018 and am not sure are the most current process. 

 

Basically I want an automatic email to be sent to only the members of the SharePoint group that have access to that page, and only when a news post is published (not updated). 

 

So I have created a test flow based on all the research I can find. It is:

 

1. When a file is created or modified (properties only) > Library name 'Site pages' > Condition (Promote is equal to 2) > if yes send email 

laura_marsden_0-1662602530973.png

 

Whilst this confuses me somewhat and I'm not sure how this works exactly, I've ran a test and functionally it works. An email was sent (just to me in this test case) when I published a news post in that SP group. BUT, it also sent an email when I edited the news post which is not really ideal. 

 

The next thing I need to understand is how to email the whole group of members as well, not just individuals. Would this require me to include a 'Initialize variable' connector? And where in the flow would this go (if this is the right connector?).

 

Any and all help is much appreciated! 

5 REPLIES 5
v-bofeng-msft
Community Support
Community Support

Hi @laura_marsden ,

 

Firstly, you could replace 'when a file is created or modified' with 'when a file is created' .

 

Secondly ,you could call SharePoint API to get the group member.

_api/Web/SiteGroups/GetByName('{YourGroupName}')/users?$select=Email

 

I've made a test for your reference :

 

vbofengmsft_0-1662615639819.jpeg

vbofengmsft_1-1662615648532.png

1

body('Send_an_HTTP_request_to_SharePoint')?['d']?['results']

2

item()['Email']

 

Best Regards,

Bof

 

 

 

Thanks heaps.

I am giving it a try with a test but it's missing values: 

laura_marsden_0-1662685781049.png

What am I joining it with? It's not clear in your image. But I have put a colon ( : ).

This works and I can save the flow.

 

However when running it, it says it can't find the group.

Is there some sort of special way the name is supposed to be written?

 

E.g. My test has these groups

laura_marsden_1-1662686868482.png

which I'm using in the flow:

laura_marsden_5-1662687475238.png

 

 

But it fails as says can't find group:

laura_marsden_3-1662686960521.png

Is this because I am the only one in the group, or because of a naming convention?

 

The actual SP group has over 100+ people in it so am not wanting to test in the live group. 

Hi @laura_marsden ,

 

Join with ";"

 

Best Regards,

Bof

laura_marsden
Frequent Visitor

Ok so I've tried the above and had little success. 

I've found some videos online which help expand on the solution above. But this also does not seem to work. 

I would love if someone could help explain how to do this and reasons why it may or may not work. 

 

My flow now looks like this:

laura_marsden_2-1662944067023.png

 

The schema I was able to pull from running the flow on a manual trigger. 

laura_marsden_1-1662943757716.png

 

For whatever reason whenever I publish a news post it doesn't send the email to that group of emails. 

It says it succeeded but it actually doesn't.

In the successful runs it says the outputs go to this email: Personal-Group@88043133P.onmicrosoft.com

However no email comes through. 

 

Can you confirm if this API will only call from a new group with all the emails for that group added to it? 

 

Cause I can't seem to get it to work with the Members, owners or visitors group. Is this because there is not actually any email entries in those groups?

Like those groups have email addresses like so: TestSPgroup-Group@8880000P.onmicrosoft.com

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Users online (3,972)