How to use UI path to fill outlook template (.otf) and save as attachment

Hi, so I was able to get information from an email and store each of them in a variable. What I want to achieve now is to place these information to an outlook template (.otf). any idea how can I do that?

Hi @gabrixxxl ,

Welcome to UiPath Community.

Please share some more information.

Thanks,
Ashok :slight_smile:

1 Like

My task is to extract specific information from an outlook email and store each of those information to a variable. and i was able to do that.

then I need to open an outlook item template from local path, and i was able to do that as well.

now, with the outlook item template opened, i need to type the extracted information (which is stored in variable) to the template. how can i do that? (see below image for the template)

Greetings @gabrixxxl ,

The best way in which I have implemented with humungous ROI is extracting the outlook template data in the form of HTML script using CurrentMail.BodyAsHtml and saving it in a text file and finding the placeholders in the HTML text where we need to have dynamic data. Then use a loop to read this text file and replace text (placeholder text) with the required dynamic data. Then this text file data is taken in string format and provided as input to Send Outlook Mail Message Body field and thereby checking IsBodyHTML in properties of Send Outlook Mail Message activity.

The time taken for manual process is 6hours for this as per the data I posses. But with the above approach which I have provided, It took close to 2 minutes. Which is why I mentioned as humungous ROI.

Please let me know, if you need further clarification on this approach.

Thank you,
Rama Krishna

Greetings @gabrixxxl ,

The best way in which I have implemented with humungous ROI is extracting the outlook template data in the form of HTML script using CurrentMail.BodyAsHtml and saving it in a text file and finding the placeholders in the HTML text where we need to have dynamic data. Then use a loop to read this text file and replace text (placeholder text) with the required dynamic data. Then this text file data is taken in string format and provided as input to Send Outlook Mail Message Body field and thereby checking IsBodyHTML in properties of Send Outlook Mail Message activity.

The time taken for manual process is 6hours for this as per the data I posses. But with the above approach which I have provided, It took close to 2 minutes. Which is why I mentioned as humungous ROI.

Please let me know, if you need further clarification on this approach.

Thank you,
Rama Krishna

I’m agree with you. Seems the best option so far :+1:

1 Like

Hello! thank you for this. but I am new to UI Path so i hardly understand it. May you explain in detail the step by step process on how to do this? :slight_smile:

Sure @gabrixxxl ,

Please follow the below series of steps.

Prerequisites–> As you need to do it for multiple emails (sending multiple emails) decide on the type of collection you have (datatable or array or any other collection). Send a sample email to yourself with that template containing the complete data.

  1. Create a sample sequence and to extract emailbody in HTML format.
    For this the activities used are Outlook App scope, For each email (with your email conditions), Write text file with CurrentMail.BodyAsHTML.
  2. Using notepad or ++ you can find the fields of the template.
  3. Make a note of the field values you want to replace, loop in a new sequence with the required collection (datatable/array/other collections). Each time in loop :
    A. Read the text file and save the data in a string variable.
    B. Use replace function to replace the field with dynamic data in
    the current iteration.
    C. Take this final output string in Send Outlook Mail Message body field
    by checking on the IsBodyHTML property.
    There you go. With the completion of loop iteration you can be able to find all the emails sent to respective recipients. (If recipients are different, I assume that you are using datatable as a collection to loop in).

Cheers,
Rama Krishna.

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