Use Power Automate, D365 F&O and Word connector to build offer letters from data stored in D365 F&O

Hello all,

In an earlier blog I shared some details about my blog and why I was doing this blogging. Basically it is to pass knowledge to the Dynamics community during the pandemic times. I also been having more time since the stay at home rules.

The idea for this blog came a few days ago, I was working on an engagement to implement a new ATS (Applicant tracking system) by the name of Jobvite. Great ATS I must say, and of the features that I liked the most was how easy it was to create offer letter templates from the system.

It got me thinking if this was possible from D365 F&O or even D365 HR. For D365 F&O there is not an OOB feature to do this, and as far as I know this feature is no longer available in D365 HR since the deprecation of the attract and on-board app. I finally decided to try to create a solution for D365 F&O. I must say that the solution is not as easy as it was with Jobvite, but the Power Platform just gives so much more power to the D365 F&O product.

This piece of the blog will be a video highlighting the Power Automate flow I created to solve this business scenario. Disclaimer, I am not a video blogger, I don’t have fancy video editing equipment or anything like that. I recorded this video using a hidden feature in Windows 10 (Windows key + G) will bring a native way to record your screen. I did some editing using windows video editor as well. Maybe with the whole stay at home rules my next venture will be to get video editing software and start a video blog. In the mean time this is what I have to work with.

Word document template

One of the most important pieces of this is the word document template. For this just open your regular offer letter in Word to start. Then add the developer tab in your ribbon. if you don’t see it, then right click on the ribbon and click customize the ribbon

2020-04-23 13_04_18-OfferLetterTemplate - Word

then check the developer checkbox

2020-04-23 13_05_56-Word Options

Then turn on design mode on your document, by clicking the design mode button in the developer ribbon

2020-04-23 13_08_00-OfferLetterTemplate - Word

this is where you start replacing the words on the letter with a variable name. On the developer tab, select to insert a plain text content control and place it where the text variables should be on the document.

2020-04-23 13_12_00-OfferLetterTemplate - Word

you can name the fields as you like. Try not to leave spaces in the words, makes it easier to select in Power Automate later.

The end result should be a letter with variables on your word document. Save this template normally in One drive or a SharePoint site.

2020-04-23 13_14_12-OfferLetterTemplate - Word

D365 F&O data entities

I used the Worker entity and CompFixedEmpls to get the salary amount for the employee.

2020-04-23 13_18_01-Edit your flow _ Power Automate2020-04-23 13_18_43-Edit your flow _ Power Automate

 

Parse Json

The Json data schema will only work if you selected the same fields on the entities I showed above. If not you may need to update your Json schema to reflect your data points.

Worker entity Json

{
    “type”: “array”,
    “items”: {
        “type”: “object”,
        “properties”: {
            “@@odata.etag”: {
                “type”: “string”
            },
            “ItemInternalId”: {
                “type”: “string”
            },
            “LastName”: {
                “type”: “string”
            },
            “FirstName”: {
                “type”: “string”
            },
            “PersonnelNumber”: {
                “type”: “string”
            },
            “AddressStreet”: {
                “type”: “string”
            },
            “AddressState”: {
                “type”: “string”
            },
            “AddressCity”: {
                “type”: “string”
            },
            “AddressZipCode”: {
                “type”: “string”
            },
            “OriginalHireDateTime”: {
                “type”: “string”
            },
            “GarnishmentTaxLevyRules”: {
                “type”: “object”,
                “properties”: {
                    “@@odata.type”: {
                        “type”: “string”
                    },
                    “PersonnelNumber”: {
                        “type”: “string”
                    }
                }
            },
            “RetailStaff”: {
                “type”: “object”,
                “properties”: {
                    “@@odata.type”: {
                        “type”: “string”
                    },
                    “PersonnelNumber”: {
                        “type”: “string”
                    }
                }
            },
            “OperatingUnit”: {
                “type”: “object”,
                “properties”: {
                    “@@odata.type”: {
                        “type”: “string”
                    },
                    “ManagerPersonnelNumber”: {
                        “type”: “string”
                    }
                }
            },
            “VendInvoiceRegisterLineHcmWorkerEntityRole”: {
                “type”: “object”,
                “properties”: {
                    “@@odata.type”: {
                        “type”: “string”
                    },
                    “ApproverNumber”: {
                        “type”: “string”
                    }
                }
            }
        },
        “required”: [
            “@@odata.etag”,
            “ItemInternalId”,
            “LastName”,
            “FirstName”,
            “PersonnelNumber”,
            “AddressStreet”,
            “AddressState”,
            “AddressCity”,
            “AddressZipCode”,
            “OriginalHireDateTime”,
            “GarnishmentTaxLevyRules”,
            “RetailStaff”,
            “OperatingUnit”,
            “VendInvoiceRegisterLineHcmWorkerEntityRole”
        ]
    }
}
CompFixedEmpls data entity Json
{
    “type”: “array”,
    “items”: {
        “type”: “object”,
        “properties”: {
            “@@odata.etag”: {
                “type”: “string”
            },
            “ItemInternalId”: {
                “type”: “string”
            },
            “PayRate”: {
                “type”: “integer”
            }
        },
        “required”: [
            “@@odata.etag”,
            “ItemInternalId”,
            “PayRate”
        ]
    }
}
Hopes this helps you with this process. Also with the power platform we can even takes this further, add an approval step before creating and sending the offer letter and then even mailing it automatically to the candidate. Let me know in the comments below if you would like to see how to do this.
In my flow, I am saving the documents on a One drive folder. See final results below
2020-04-23 13_27_11-Offer Letters2020-04-23 13_27_42-Offer Letter 1217.pdf - Adobe Acrobat Standard 2017
Until next time,
Juan Sebastian Grijalba, CPA

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s