This article outlines, how to generate an automated payment reminder in Microsoft Flow.
In this step-by-step description, we create a scheduled Flow that executes a DocumentsCorePack template against a list of invoice records where the due date is on or before today’s date. For each result, an overdue notice is sent using a standard email in Dynamics 365.
1. Create a scheduled Flow.
We build a scheduled Flow and define when to execute it.
2. Get overdue invoices.
Click on [Create] and select the “List rows” action of the Microsoft Dataverse.
Please select the entity(table) from which you want to start. In this example, we start from the entity(table) Invoice.
Since we only want Invoice records where the due date is on or before today and the status is “active”, we added a filtered Fetch-XML.
3. Create Document.
Within the “Apply to each”-Section, we use the DocumentsCorePack Connector to add a “Create Document Job (sync)”-Action.
Select a template that is based on Invoice and select the InvoiceId as the EntityId. In our example, the file type has to be HTML since we want the document to be placed as the content of our email.
4. Create an Email record.
Click on [Add an action] to add a new row and to specify it as an email message.
5. Attach the document to the email.
Please press [Add an action] again to select the “Attach DocumentJob to Email”-Action from the DocumentsCorePack Connector.
Provide the DocumentJobId and the EmailId to make sure each result document will be attached to the email.
6. Send the email.
For our final action, we need to add the “Send email” action of the DocumentsCorepack connector.
Provide the Email record, a sender, and a recipient before you save your flow.
The final flow should look like the following, you are ready to test your flow.
That’s it! We appreciate your feedback! Please share your thoughts by sending an email to email@example.com.