cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
yougan
Helper V
Helper V

how to send an email to users in sharepoint groups from flow

how to send an email to users in SharePoint groups from flow

that group has around 100 users

and if not possible directly how do we make rest call to target the groups. Please share me clear steps on how to achive this requirement. 

1 ACCEPTED SOLUTION

Accepted Solutions
v-xiaochen-msft
Community Support
Community Support

Hi @yougan ,

 

It seems that this account does not have Outlook permissions.

This will be another question.

 

Finally, I want to ask you to confirm a formula:'your flow name'.run("Test")

You only need to replace Concat( Office365Groups.ListGroupMembers("your group id").value.mail,mail,";") with "Test"

If the formula does not report an error, the problem is with the Outlook connection.

If you solve the outlook problem, I think you will succeed.

 

Best Regards,
Wearsky
If my post helps, then please consider Accept it as the solution to help others. Thanks.

View solution in original post

23 REPLIES 23
v-xiaochen-msft
Community Support
Community Support

Hi @yougan ,

 

According to your description, I've made a test for your reference:

 

1\ Find the email of all users in your SP group. This is my test SP group:

Office365Groups.ListGroupMembers(First(Office365Groups.ListOwnedGroups().value).id).value.mail

v-xiaochen-msft_0-1610431338465.png

 

v-xiaochen-msft_1-1610431338467.png

 

 

2\ Build a test flow

v-xiaochen-msft_2-1610431338470.png

 

Initialize variable Value: Ask in powerapps

 

3\ Add the flow to canvas app . Add a button control and set its onselect property to:

'PowerApp->Initializevariable,Sendanemail(V2)'.Run(Concat(Office365Groups.ListGroupMembers(First(Office365Groups.ListOwnedGroups().value).id).value.mail,mail,";"))

//'PowerApp->Initializevariable,Sendanemail(V2)' is the name of my flow

 

4\ The result is as follows:

v-xiaochen-msft_3-1610431338471.png

 

 

In addition , If you want to use Rest API to get users’ mailbox instead of canvas app, I think this link will help you a lot: Here 

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

Hi Wearsky,

updated: 

done

Thank you for the response.

 

Please clarify my below questions

I have attached SP group and office 365 group 

 

I am not sure how to start this, you have mentioned SP group in your first comment which one is SP group and I am not sure how to declare those parameters one by one. 

 

can you please explain with step by step with my examples ?

how do we target SharePoint group here? 

which one is better using reset api or using power app? 

v-xiaochen-msft
Community Support
Community Support

Hi @yougan ,

 

Please delete the picture, this may cause information leakage problems.

 

Best Regards,

Wearsky

v-xiaochen-msft
Community Support
Community Support

Hi @yougan ,

 

For the first question, In my test, I am the owner of the SP group, so I used the above formula. I got all the emails from this group.

This is just an example. This formula can get many groups, not necessarily SP groups.

You could try to change the formula according to your needs and get the SP group you need.

 

For the second question, I think both methods will work, it depends on you. I am a powerapps supporter, so I generally use the first method to solve this problem.

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

HI Wearsky,

 

May I know how you begin the power app and I mean how you insert power app in flow? 

and also I tried to canvas app from there on which property I should apply above formulae?

and also what type of flow you have selected?

 

v-xiaochen-msft
Community Support
Community Support

Hi @yougan ,

 

1\ Add a button control

 

2\Choose this

 

v-xiaochen-msft_0-1610445705888.png

 

 

3\ Add a flow you need.

v-xiaochen-msft_1-1610445705892.png

 

 

4\ Enter the parameters that need to be passed to flow. This formula is on the onselect property of button control

v-xiaochen-msft_2-1610445705893.png

 

// ** is the mail string.

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

Hi Wearsky,

 

Thank you for the response.

 


Please clarify my below questions:
1.
I Added a button and on Action -->powerautomate--> it is showing to add a new flow but not existing flows..

which flow I should select? from below screenshot "FlowType"

 


2. My SHarePoint group name is "Test Members" ,so in the below screenshot "GroupName" , Do I need to replace "First" with My group Name?

 

3. Should I create a first flow or canvas app? please give me over all sequence of steps. Thank you

v-xiaochen-msft
Community Support
Community Support

Hi @yougan ,

 

1\ For your first question:

Since you trigger this flow through a button in powerapps. So you should create an instant flow. Like the picture below:

v-xiaochen-msft_0-1610528878480.png

 

v-xiaochen-msft_1-1610528878486.png

 

 

2\ For your second question:

Yes, your idea is correct. My formula is just an example, you need to modify the formula according to your group.

You could try the following formula:

'PowerApp->Initializevariable,Sendanemail(V2)'.Run(Concat( Office365Groups.ListGroupMembers(LookUp( Office365Groups.ListOwnedGroups().value,displayName="Test Members").id).value.mail,mail,";"))

Please note that there is no other group called “Test Members” in your own group.

 

3\ For your third question

Yes, You should create a new canvas app and a new flow.

v-xiaochen-msft_2-1610528878488.png

 

v-xiaochen-msft_3-1610528878492.png

 

 

Best Regards,

Wearsky

If my post helps, then please consider Accept it as the solution to help others. Thanks.

Hi Wearsky,

 

Thank you for the response. I tried but seeing error., not sure where I am doing wrong. Please help further.

I have attached screenshots. 

 

 

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Top Solution Authors
Top Kudoed Authors
Users online (43,779)