In this blog, I am going to show you that how to automate the generation of offer letter using SAP BTP Process Automation.
Overview of the Automation Process
This automation process involves opening a Word file template, replacing placeholders with the new joinee’s details, saving the customized offer letter, and sending it via email to the respective candidate.
First of all, we should have a offer letter template saved as docx file in our desktop as below :
Create a new automation project
Log into SAP Build Lobby.
Click create -> Automated Process->Automation and click on next
Name your project ‘OfferLetterGenerator’.
Provide a short description “Bot to generate offer letter”.
Click on ‘Review’ and then ‘Create’.
Designing the Automation Bot
In the automation section, click create -> automation and give the agent version
name it ‘Offer Letter Generator’ and add description as ‘ An automation which generates offer letter and send email to respective candidate’.
Click on create.
Click on setting option, go to dependencies and click on add -> Add a business process project dependency, then add ‘outlook SDK’ and ‘word SDK’ ( as in this automation we are going to use WORD and OUTLOOK so it is necessary as it makes available the different activities related to that particular software in our activities section )
Similarly add word SDK.
The key input parameters for this automation are:
companyNamecandidateNamecanAddresscurrentdateposttechnologyunitcitysalaryjoiningDateHrManagerNamehremailHrPhoneNumbersenderemailreceiveremail
So go to Input/Output section and create those input parameters as like : –
Similarly add all other input parameters as well.
Now, Add these activities by drag & drop from the tools section : –
i) Open Word Instance
ii) Open Document(Word)
iii) Replace All(Word)
iv) Save As(Word)
v) Close Document (Word)
vi) Close Word Instance
vii) Open Outlook Instance
viii) Send Email (Outlook)
ix) Close Outlook Instance
In Open Document (Word) activity, in parameter section add the path of offer letter template in ‘documentPath’ field.
And in ‘replace all (word)’ activity give the placeholder and value name in old string and new string section for each detail which is needed to be replaced ,
as like this:
Similarly do for all placeholders.
After that, in Save As (Word) activity set the filepath as ‘ “{Folderlocation}\” + Step0.candidateName + “_Offer_Letter.docx” ’ ( so that the new offer letter word file generated is saved as that respective candidate name).
Now go to Send Email (Outlook) activity, and add parameters as,
from -> senderemail
to -> receiveremail
Subject -> Letter of Joining
Body -> “Please find the offer letter attached and report to the assigned location on exact date.”
In attachment section click on custom data and add string value as the file location as
‘ “{Folderlocation}\” + Step0.candidateName + “_Offer_Letter.docx” ’
Finally, Run the automation and fill the details in input fields : –
then click on test and you will find that a word file of offer letter with candidate name created at the folder location and a mail is sent to respective receiver.
Benefits of this automation: –
Automating the offer letter generation process significantly reduces the time required to create and send offer letters.It minimizes the risk of human error, ensuring that all details are correctly filled in.The use of a standardized template ensures that all offer letters maintain a consistent format and tone.
In this blog, I am going to show you that how to automate the generation of offer letter using SAP BTP Process Automation.Overview of the Automation ProcessThis automation process involves opening a Word file template, replacing placeholders with the new joinee’s details, saving the customized offer letter, and sending it via email to the respective candidate.First of all, we should have a offer letter template saved as docx file in our desktop as below :Create a new automation projectLog into SAP Build Lobby.Click create -> Automated Process->Automation and click on nextName your project ‘OfferLetterGenerator’.Provide a short description “Bot to generate offer letter”.Click on ‘Review’ and then ‘Create’.Designing the Automation BotIn the automation section, click create -> automation and give the agent versionname it ‘Offer Letter Generator’ and add description as ‘ An automation which generates offer letter and send email to respective candidate’.Click on create.Click on setting option, go to dependencies and click on add -> Add a business process project dependency, then add ‘outlook SDK’ and ‘word SDK’ ( as in this automation we are going to use WORD and OUTLOOK so it is necessary as it makes available the different activities related to that particular software in our activities section )Similarly add word SDK.The key input parameters for this automation are:companyNamecandidateNamecanAddresscurrentdateposttechnologyunitcitysalaryjoiningDateHrManagerNamehremailHrPhoneNumbersenderemailreceiveremailSo go to Input/Output section and create those input parameters as like : -Similarly add all other input parameters as well.Now, Add these activities by drag & drop from the tools section : -i) Open Word Instanceii) Open Document(Word)iii) Replace All(Word)iv) Save As(Word)v) Close Document (Word)vi) Close Word Instancevii) Open Outlook Instanceviii) Send Email (Outlook)ix) Close Outlook InstanceIn Open Document (Word) activity, in parameter section add the path of offer letter template in ‘documentPath’ field. And in ‘replace all (word)’ activity give the placeholder and value name in old string and new string section for each detail which is needed to be replaced ,as like this:Similarly do for all placeholders.After that, in Save As (Word) activity set the filepath as ‘ “{Folderlocation}\” + Step0.candidateName + “_Offer_Letter.docx” ’ ( so that the new offer letter word file generated is saved as that respective candidate name). Now go to Send Email (Outlook) activity, and add parameters as,from -> senderemailto -> receiveremailSubject -> Letter of JoiningBody -> “Please find the offer letter attached and report to the assigned location on exact date.”In attachment section click on custom data and add string value as the file location as ‘ “{Folderlocation}\” + Step0.candidateName + “_Offer_Letter.docx” ’Finally, Run the automation and fill the details in input fields : -then click on test and you will find that a word file of offer letter with candidate name created at the folder location and a mail is sent to respective receiver. Benefits of this automation: -Automating the offer letter generation process significantly reduces the time required to create and send offer letters.It minimizes the risk of human error, ensuring that all details are correctly filled in.The use of a standardized template ensures that all offer letters maintain a consistent format and tone. Read More Technology Blog Posts by Members articles
#SAP
#SAPTechnologyblog