cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rajat281293
New Member

Mail merge with unique attachment in desktop version

I have been trying to create a workflow for mail merge with unique attachments in Power Automate Desktop. I have an excel list of email ids.  And all the files in a folder. Please help. I am new to this.

1 ACCEPTED SOLUTION

Accepted Solutions

ColumnName is the name of the column in your Excel file. You don't need all those extra variables

View solution in original post

15 REPLIES 15

Getting this error.

 

Robin.Core.ActionException: Failed to send email message ---> System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Runtime.InteropServices.COMException: Outlook does not recognize one or more names. --- End of inner exception stack trace --- at System.RuntimeType.InvokeDispMethod(String name, BindingFlags invokeAttr, Object target, Object[] args, Boolean[] byrefModifiers, Int32 culture, String[] namedParameters) at System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) at System.Type.InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, CultureInfo culture) at Robin.Modules.Outlook.Actions.OutlookActions.InvokeMethod(Object o, String methodName, Object[] methodArgs) at Robin.Modules.Outlook.Actions.OutlookActions.SendEmailThroughOutlook(Variant outlookInstance, Variant account, Variant from, Variant to, Variant cc, Variant bcc, Variant subject, Variant body, Variant attachments, Boolean isBodyHtml, Int32 sendEmailFrom) --- End of inner exception stack trace --- at Robin.Modules.Outlook.Actions.SendEmailThroughOutlook.Execute(ActionContext context) at Robin.Runtime.Engine.ActionRunner.RunAction(String action, Dictionary`2 inputArguments, Dictionary`2 outputArguments, IActionStatement statement)

Might be caused by the recipient address? If you get that from Excel, try to use trim before to remove whitespaces.

rajat281293
New Member

I don't think so. I used VBA coding for the same. It worked fine through that excel. 

fraenK
Memorable Member
Memorable Member

PAD is not VBA 😉

rajat281293_0-1618682709722.png

This is how I extracted all my data from different columns into list such as To sent, cc, subject, document path. 

Did that. Still same. Have a look at the screenshots I posted in this comment and others. 

rajat281293_0-1618683521834.png

 

rajat281293_1-1618683581660.png

 

fraenK
Memorable Member
Memorable Member

the error comes from the send email action

yes. I reduced my email list to just 1 line. It worked fine. There is something wrong with the way I am extracting my data from excel I guess

fraenK
Memorable Member
Memorable Member

You are sending to a list variable, which values are separated by comma. Outlook recognizes semicolon by default.

Do you really want to send one single email to all recipients? Otherwise you need to go through every row of your columns. 

%ExcelData[rowNumber]['ColumnName']

https://docs.microsoft.com/en-us/power-automate/desktop-flows/variable-data-types#advanced-data-type...

 

No. I dont wanna send a single email to all the recipients. I wanna send individual mail to each of them. So what should I do now?  For loop used here should do that, right?

yes

for each in %ExcelData%

%CurrentItem['ColumnName']

Still not working. 

 

It is saying Index 'Tosent' is invalid.

ToSent is my list of email ids

ColumnName is the name of the column in your Excel file. You don't need all those extra variables

View solution in original post

Worked perfectly fine. Thanks a ton🤗

Helpful resources

Announcements
MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

MPA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

Top Solution Authors
Users online (55,020)