Showing results for 
Search instead for 
Did you mean: 
Regular Visitor

How split a string with email addresses into an array

Hi , i need to extract the email addres into a string like that


into an array 



in order to apply a for each on the array


Any help is very appreciated, thank YOU!


Resident Rockstar
Resident Rockstar

sorry, i've written too "simple" my question..

I need to extract all the recipient from a "export mail V2" function .

I have to get all the chars after "To: " , extract only the email address and put them into an array

Can you help me ?


Resident Rockstar
Resident Rockstar

Could you show your flow?

Regular Visitor

1) found the index of "To: "from the export mail

iniziorigagrezza = indexOf(outputs('Export_email_(V2)')?['body'],'To: ')

2) get 2500 chars from the "To: " rigadest = substring(outputs('Export_email_(V2)')?['body'],variables('iniziorigagrezza'),2500)

3) remove the "To: " from the string rigadestpulita = replace(variables('rigadest'),'To: ','')

4) i'm there ... I need to find a way to extract only emailaddresses from "rigadestpulita"


thank you


Resident Rockstar
Resident Rockstar

Why did you decide that 2500 is the right length of substring?

You have to find first CRLF combination after To: to get the string of addresses.

After that you can use split function to get the array.

ok i've fixed the 2500 char issue and set it to CRLF , now how can i split from a string like that ? 

", Tom Pat <>"





Resident Rockstar
Resident Rockstar

Initialize the variable of type array with this expression:


Helpful resources

UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (3,339)