I am trying to pull from a SharePoint list to send an email to a group of people using power automate?
I am following the below steps in power automate
Step 1 Trigger
Step 2 Get Email List – this is pulling from the SharePoint list that contains the emails
Step 3 Select statement. I am mapping email and pulling the email column from the SharePoint List.
Step 4 Send an Email
Step 3 output is below
Here’s the error:
I understand that I need to turn the output from Step 3 into a string so I can send the email, but I’m having trouble doing so. I am obviously able to pull the email directly from the sharepoint list and place it as the sender, but that’s creating three separate emails. The goal is to have one email.
I have tried creating a Select and using the output from that. I have also tried creating an HTML table but since it has the table format I’m able to get it to go into a string.
Hirstmj is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.
Based on the exception:
Input parameter ‘To’ is required to be of type ‘String”, the source
type is ‘object’
This means the input type is wrong. You are providing an object, but it expects a string.
You need to convert your list of email addresses to a semicolon-separated string.
Example:
[email protected];[email protected];[email protected]
Here is an example setup for demonstration. I initialize an array, add two email addresses, and combine them using the join function with a semicolon separator:
This style of pattern will work for you …
Step 1.
The Initialize Email Addresses Array
is an array variable that stores the array you provided in your question. You’ll already have that.
Step 2.
You need to initialize another array (Initialize Email Addresses Primitive Type Array
) that will store original array but transformed out of an object structure into a primitive string type structure for each item.
Step 3.
Loop over each item in the original array and append the value of the email (expression = item()['Email']
) to the array created in step 2.
Step 4.
Use the Join operation to join the values from the primitive array into the string that represents the email addresses that will be passed into the Send an email (v2) operation.
Result