cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
StandaCZE
Regular Visitor

Get Group Members - send email

Hello,

 

I just created flow, where user will choose in Form on SharePoint site specific distirbution group and this flow will send them list of members of that distribution group.

 

Right now I am having a problem, that for each member, the requester will receive one emails.

10 members in distirbution groug = 10 emails with each member.

Is there any way how to send only one email with all members in Automate Flow?

This is how my flow looks:

StandaCZE_0-1621863086904.png

 

StandaCZE_1-1621863161335.png

 

I would really appreciate any help.

 

Thank you and have a nice day,

Best regards, Stanislav Kvída

1 ACCEPTED SOLUTION

Accepted Solutions
StandaCZE
Regular Visitor

Hello @DamoBird365 

 

Thank you again for your help. I was looking at this problem yesterday and I was able to figure it out but thank you for direction me :-).

Here is a screen of final solution:

StandaCZE_0-1624519371903.png

 

 

Now it is working like a charm :-).

 

Once again, thanks ;-).

View solution in original post

11 REPLIES 11
DamoBird365
Super User
Super User

Hi @StandaCZE 

 

Use the select action and a compose with a join on a comma, would give you a list of display names.

 

DamoBird365_0-1621865757600.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

Hello @DamoBird365 

 

I should mentioned I am beginner here :-).

Can you please be more specific how should I use? Where should I insert these action fields?

And also my select is little different:

StandaCZE_1-1622206811317.png

 

And I found compose but i do not know how to set it up.

 

Can you please tell me how to set it up exactly? Like I said, I am beginners in this and I do not know how exactly use variables/select fields.

 

Thank you very much!

Best regards, Stanislav Kvída

Hi @StandaCZE 

 

After your get members action, insert a select and a compose.  The expressions are in the comments on the screenshot.  You should be able to rebuild these by typing them as you see them in the expression builder.  

 

You can then choose the value from the compose action as your TO of the Email action.

 

You can see the select in action here https://www.youtube.com/watch?v=6nJSUNh579w&t=792s

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

 

 

Hello,

 

Thanks a lot. Video is great and thanks for those comments in screens. I did not notice it before.

I was able put everything into one email .. finally :-). So thank you for that.

 

But could you help me with one more thing?
This is how the flow looks now:

StandaCZE_0-1622452977614.png

Expressions are in the comments.

 

And this is how I get email with members:

StandaCZE_1-1622453097848.png

Is there a way how to get only the Display Name, for example Stanislav Kvída?

And can I add enter between the members? To have each member on new line?

 

Thank you very much!

 

Have a nice day,

Standa

Hi @StandaCZE 

 

You need to put the map of select action into advanced mode.  Your item() should be in a single cell, you have it in the key.

 

To join with a return line, create a compose with a ; and a return line i.e. everything between <-----------> below.

 

<----------->

;

 

<----------->

 

Then you can join the select array on the compose.

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

Hello @DamoBird365

 

Thanks for the info. I switch the "select" action and now it is working. The body of the emails looks great.

 

But I do not understand what exactly to do with "compose" action. I tried something, google it but maybe I used wrong keyword.

Can you please explain to me little more detailed?

This is my "compose":

StandaCZE_0-1622625590316.png

 

Basically, my goal is to have each member (displayName) of that specific group on new line in the mail (and behind that member no "," or ";").

 

Thank you very much for your help,

Best regards, Stanislav Kvída

 
The expression:  join(body('select'),outputs('Compose'))
 
where your compose is as follows:
 
DamoBird365_0-1622632988504.png

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

Hello @DamoBird365 

 

Thanks for the respond.

 

But unfortunately It doesn´t work for me. When I use your expression, I have this error:

 

Flow save failed with code 'InvalidTemplate' and message 'The template validation failed: 'The 'inputs' property of template action 'Compose' at line '1' and column '7114' is not valid. The action cannot reference itself.'.'.

 

My flow looks like this:

StandaCZE_1-1623066693459.png

Can you please tell me where I have an error?

 

Thank you very much and have a nice day,

Best regards, Stanislav Kvída

HI @StandaCZE 

 

Two problems:

1. you are referencing yourself - hence the error.  Your expression in compose is calling on itself. 

2. you are missing a compose with a return and ; in it

 

Insert a compose, call it return with a ; and a return, then reference that in your join outputs('return').

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Cheers,
Damien


P.S. take a look at my new blog here and like & subscribe to my YouTube Channel thanks 😉

StandaCZE
Regular Visitor

Hello @DamoBird365,

 

Thank you for your respond. Unfortunately I am not capable to put it together from what you are writing.
I did some progres though but something is still missing.

 

Now it looks like this:

StandaCZE_1-1623151989341.png

 

 

Can you please tell me exactly what should be in compose "return"?

And please, put it to qoutes.

 

Thank you very much,

Best regards, StandaCZE

StandaCZE
Regular Visitor

Hello @DamoBird365 

 

Thank you again for your help. I was looking at this problem yesterday and I was able to figure it out but thank you for direction me :-).

Here is a screen of final solution:

StandaCZE_0-1624519371903.png

 

 

Now it is working like a charm :-).

 

Once again, thanks ;-).

Helpful resources

Announcements
MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

PA Survey Carousel Image.png

We want to hear from you!

If you are a small business ISV/Reseller, share your thoughts with our research team.

Users online (1,057)