web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / How split a string wit...
Power Automate
Unanswered

How split a string with email addresses into an array

(0) ShareShare
ReportReport
Posted on by 14

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

"tom@contoso.com, joe@acme.net, tim@contoso.com"

into an array 

{

tom@contoso.com

joe@acme.net

tim@contoso.com

}

in order to apply a for each on the array

 

Any help is very appreciated, thank YOU!

 

Categories:
  • VictorIvanidze Profile Picture
    13,083 on at
  • PatrizioB Profile Picture
    14 on at

    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 ?

     

  • VictorIvanidze Profile Picture
    13,083 on at

    Could you show your flow?

  • PatrizioB Profile Picture
    14 on at

    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

     

  • VictorIvanidze Profile Picture
    13,083 on at

    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.

  • PatrizioB Profile Picture
    14 on at

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

    "nadya.volk@crvd.net, Tom Pat <tom.pat@crvd.net>"

     

     

     

     

  • VictorIvanidze Profile Picture
    13,083 on at

    Initialize the variable of type array with this expression:

    split(variables('var1'),',')

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 414

#2
11manish Profile Picture

11manish 331 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 274

Last 30 days Overall leaderboard