Insert Name from excel column into Outlook email body


I have a file which contains names in one column. I already have a flow set up that has a For Each Row to create an email for each row that has an email in the Email Address column. However, I want to send an email using outlook desktop (or outlook 365, if I cant achieve this using desktop) where I will insert the name into the body of the email (“Dear xx,”) sending the same email to every person on the spreadsheet, but the name will be different of course.

Thank you!

Hi @jibroni,

Might be the email body would be static regardless to the name, so as you mentioned (“Dear xx,”) in this in the place of xx you can put the name of person you are getting from the for each activity, this you can get it using the replace function


HI @jibroni

Can you share the screen shot of you XAML file and explain a bit more about you query?


Hi @Sanjit_Pal , thanks for your reply. As I am new to StudioX, where exactly do I insert the " mailBodyString.Replace(“xx”,item(“Name”).ToString)"?

Also, to provide more context, my file has a “Name” column next to the “Email Address” column, so the Name would be pulled from the file into each email sent.


it means in XX the text you need to replace from your string. and name the column name of your datatable example

ilBodyString.Replace(“Email: ”,item(“Email Address”).ToString)


@fernando_zuluaga as you said your name should be dynamic, so for this in the place of name you can write any static word(for example: XX) and you can replace that static word with the name you getting from the datatable.

Hi @Sanjit_Pal
I understand the concept, I just dont understand where in StudioX do I place the string you provided?

Hi @jibroni,
You can directly use the assign activity to do this.
maiilBodyString = maiilBodyString.Replace(“Email: ”,item(“Email Address”).ToString)
LeftSide = RightSide

Hi @Sanjit_Pal , StudioX doesnt seem to have that option?

Hi @jibroni

Use → Save For Later activity it will act like assign activity in Studio

Have a look on the user interface of Studiox


1 Like

Hi @Sanjit_Pal

I’ve attached my StudioX file. Would you be able to show me where to add the string?
Main.xaml (54.9 KB)

Dear @jibroni,

Use the zip file in order to replace the static string with the dynamic string. (49.6 KB)
Sanjit Pal

Hi @Sanjit_Pal

Thanks for your help. I was actually able to solve my issue using the HTML editor in the Send Email activity.

This, combined with the for each excel row, I am able to send an email to each person on my spreadsheet and replace the XX using the add data value, by mapping the data value to the excel row that contains their names.

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.