Hi all - I've read through the threads for a number of other users who received a similar error when trying to send an email to multiple addresses, but none of those solutions seem to be fixing this for me.
In this flow, I'm scheduling a weekly report to send new list items only to the users whose emails are in a dynamic people field. In the start of the flow I get list items and filter for the last 7 days; in one branch I select the most important columns to display, and create an HTML table with that data; in the other branch I get emails from the filtered items, use a union to pare that down to unique emails ('uniqueEmails'; for users who have more than one item assigned), initialize a string variable, and then append the outputs of 'uniqueEmails' to EmailsString.
I've been unable to figure out how to get around this string/email format error on my Send an email action. Will someone please help me?
Solved! Go to Solution.
That looks like an object converted to a string, it'll add the \ before special characters. 'Compose' action does remove those characters automatically, that's why it works fine with it.
I'd take one step back, to the point where you extract the email addresses. I don't think you need the key 'eMail' in there, it would be much easier if you took only the email addresses. If you use 'Select' action to do that, switch to the text mode and take only the emails.
Hello @bcsanfilippo ,
do you append the emails to a string variable including the separator ; ?
Thanks for your response, @tom_riha . Yes, I have a semicolon after the "current item" dynamic content for emails. Here's a picture of just that action:
And if I peek code on that, I have:
{
"inputs": {
"name": "EmailsString",
"value": "@{items('Append_EmailsString_ApplyToEach')};"
}
}
Then I'd try to add 'Compose' action right before the email and store the EmailsString variable in there. Just to check what value it has before it enters the 'Send an email'.
Good thought.. so in a Compose, it's showing input:
"{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};"
and output:
"{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};"
(actual email addresses replaced with EMAIL@EMAIL in these snippets, of course)
I'm not seeing any difference.. but when testing this flow with a Compose action instead of a Send an Email action it runs successfully. When I add the Send an Email action back in... flow fails. Same error that it's not seeing this as format 'string/email'.
I'm stumped!
That looks like an object converted to a string, it'll add the \ before special characters. 'Compose' action does remove those characters automatically, that's why it works fine with it.
I'd take one step back, to the point where you extract the email addresses. I don't think you need the key 'eMail' in there, it would be much easier if you took only the email addresses. If you use 'Select' action to do that, switch to the text mode and take only the emails.
I need to read up on why exactly this worked, but it did... I changed my getEmails (Select) action to text mode and mapped to the dynamic email content - flow runs successfully! Thank you!
Oh, reading comprehension... you already explained to me why that key mapping matters!
For anyone reading through this thread in their own searches, when I used a key in the Select action instead of just mapping directly to the dynamic content, my output was
"{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};{\"eMail\":\"EMAIL@EMAIL\"};"
but when I mapped directly to the dynamic content, my output was
"EMAIL@EMAIL;EMAIL@EMAIL;EMAIL@EMAIL;EMAIL@EMAIL;EMAIL@EMAIL;"
It's the extra key identifier garbage that was throwing a formatting error. Thanks again, @tom_riha !
User | Count |
---|---|
95 | |
47 | |
21 | |
19 | |
18 |
User | Count |
---|---|
137 | |
53 | |
42 | |
40 | |
28 |