cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Dhinesh28R
Post Prodigy
Post Prodigy

O365 group members into string

Hi,

In my app i need to send email for Users and O365 group members.

Am using variable in Send Email To address.

 

So i need to get all O365 members Email in that variable.

Its an array value.

How to convert this array into string?

 

 

Thanks,

Dhinesh

1 ACCEPTED SOLUTION

Accepted Solutions

@Dhinesh28R 

 

Presuming an array like this:

 

["a@example.com","b@example.com","c@example.com"]

 

You can turn it into a string separated by Semicolons, which should be suitable for the To field in Actions like "Send and Email" Action, like this:

 

 

join(outputs('Compose'),';')

 

 

instead of outputs('Compose') above you can put whatever Action Block Outputs is having the Array of e-mail addresses.

 

Example below:

 

82321-eml-join-01.png

 

When testing the run, it is successful:

 

 

82321-eml-join-02.png

 

Output is

 

a@example.com;b@example.com;c@example.com

 

In send an email Action's To field, in order to send to multiple people you need a string with each email addresss separated by a semicolon. If it is an Array of e-mail addresses right now, then using the join expression and the Array as first argument, and then the semicolon character in single quotes as the second argument should accomplish the goal.

 

Check if the above helps @Dhinesh28R 

 

 

View solution in original post

6 REPLIES 6

@Dhinesh28R 

 

Presuming an array like this:

 

["a@example.com","b@example.com","c@example.com"]

 

You can turn it into a string separated by Semicolons, which should be suitable for the To field in Actions like "Send and Email" Action, like this:

 

 

join(outputs('Compose'),';')

 

 

instead of outputs('Compose') above you can put whatever Action Block Outputs is having the Array of e-mail addresses.

 

Example below:

 

82321-eml-join-01.png

 

When testing the run, it is successful:

 

 

82321-eml-join-02.png

 

Output is

 

a@example.com;b@example.com;c@example.com

 

In send an email Action's To field, in order to send to multiple people you need a string with each email addresss separated by a semicolon. If it is an Array of e-mail addresses right now, then using the join expression and the Array as first argument, and then the semicolon character in single quotes as the second argument should accomplish the goal.

 

Check if the above helps @Dhinesh28R 

 

 

Hi @poweractivate,
In my O365 Ad group am having 3 users .

But its shows only one users.

flowaray.JPG

 

My flow is correct or not?

Its not sending mail to O365 group members.

 

Thanks,

Dhinesh

@Dhinesh28R 

 

1. If you are appending to a variable, The Send an E-mail maybe need to be outside and after the Apply to Each

 

2. It depends on "value" in Apply to Each. The problem may be with the Action Block that is outputting "value" - double check it to see if it needs to be adjusted.

Hi @poweractivate,

 

Am getting following error,

mailerr.JPG

 

While composing .

 

Thanks,

Dhinesh

@Dhinesh28R 

 

Try join(array()) and see if it works. It depends what is the value of the string though.

Hi @poweractivate,

Now its working man.

 

Thanks,

Dhinesh

 

Helpful resources

Announcements
Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Users online (1,664)