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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Convert Array into Ref...
Power Automate
Unanswered

Convert Array into Reformatted String of Email Addresses

(1) ShareShare
ReportReport
Posted on by 39
Hello,
 
I need to have the output of an array that includes values from a Sharepoint List converted into a string with only the emails. The column it is pulling from is of type Choice.
The output is a list of email addresses, but the values are currently being pulled with extra characters, which means I cannot add the output as Dynamic Content in the 'To:' section of the 'Send an email (V2)' action. I've seen other solutions online that only seem to work if you want to send a separate email to each user with the Apply to Each function, but I want to send 1 email to all unique users.
 
Output I'm trying to fix:
 
I need this to instead be returned as just a string of the email addresses, separated only by a space, at most.
Or, I need an additional action/ expression that will convert it to that format.
 
-----------------------------------------------------------------------------------------------------------------------------------
 
Here is the whole list of actions ('Get items' action used to access Sharepoint List items is above these):
 
------------------------------------------------------------------------------------------------------------------------------------
 
Action Details:
 
---------------------------------------------------------------------------------------------------------------------------------
 
'BuyerEmail.Value' Expression: item()?['BuyerEmail']?['Value']
 
'Compose - Remove Duplicates' Expressionunion(outputs('Compose_-_Empty_Array'),body('Select_-_Users'))
 
---------------------------------------------------------------------------------------------------------------------------------
 
Thank you for taking the time to read this. 
Thank you in advance for any help.
 
Cheers
Categories:
I have the same question (0)
  • Verified answer
    SudeepGhatakNZ Profile Picture
    14,394 Most Valuable Professional on at
    You need to first update the Select action. Switch to text mode
     
     
    This will return the array as:
     
    [
    "john.doe@example.com",
    "jane.smith@example.com",
    "david.johnson@example.com",
    "emily.brown@example.com",
    "michael.wilson@example.com"
    ]
     
    Then use join action
     
     
    Final Output
     
     
     
  • CU18091915-0 Profile Picture
    39 on at
    @SudeepGhatakNZ Amazing. Fixed in 10 minutes what I've spent a few hours troubleshooting. Sincerest thanks.
     
    For posterity, the main issue causing the extra characters was fixed by just using item()?['BuyerEmail']?['Value'] expression in the text mode of the Select action, and deleting all other characters that had automatically populated. The '?['Value]' part of the expression is only used because the Sharepoint List column is Choice type, and this keeps it from pulling in other metadata characters.
     
    The only change I made to Sudeep's suggestion was using a space instead of a semicolon for the 'Join with' value in the 'Join' action. This is because my email addresses were already stored with a semicolon on the end.
     
    Again, sincere thank you, Sudeep.

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard