Send DoR as an e-mail attachment

Extract DoR and send as an e-mail attachment in power automate workflow.
The following video explains the steps needed to extract DoR from the submitted data

In this video, we will take a look at extracting the document of record and attaching it as an email attachment in the Microsoft Power Automate Workflow. As you can see, I have opened up the Power Automate Workflow in the edit mode, and the very first step is the schema that you associate whenever an HTTP request is received to trigger this particular workflow. As you can see in the schema, there are some elements here. The data will contain the data of the adaptive form, the attachments will contain the attachments associated with the adaptive form, and the document element will contain the document of record. So in the next step, we need to get hold of the document of record object here. So to do that, I’m using an initialized variable step here. I’m going to select the document here from the schema.
So this will give me the document of record object with these elements, the file name, data, content type, and size. So as you can see, the binary content of the generated document of record is in this data element and we need to extract this particular data URI from this DoR object. So in my next step in the workflow, I’m getting the data element here. So if you see, I’m getting “Get DoR Object” DoR data and the Get DoR Object was got in the previous step. In the next step, I get the, I convert the data URI to binary using the out of the box function, which Microsoft Power Automate provides. So I’m using the right URI to binary and to that function, I’m going to pass the output of the previous step. That is get document of record URI. So once you have this, you can now easily include this particular binary content as an email attachment. So to do that, I go into my email, send email notification component through here, and then I can click on the attachment. And here, I can select the Get DoR from DoR URI here. And in the attachment name, either you can hard code it or you can extract the file name from the DoR object. As you can recollect, the file name is stored in an element called file name in the DoR object. So I’m simply doing that. So now, I can save this workflow here. And if I were to trigger this workflow, so this is my form that is associated to trigger that particular workflow. Let’s say I changed this name to James, and my email is there and then I hit on submit.
I should get an email attachment with the generated document of record here. So if I go. So now that our form was submitted, let’s take a look at how the email would look like with the attachment. So for that, I’m opening up my email client here, and there is this notification generated by Power Automate, which has a generated document of record as an attachment here. So this is the testingpa.pdf. That’s the DoR as an attachment. And that’s the dear James. That is the data from the submitted form. So let’s open up this PDF and see how it looks like.
So this is the generated DoR. Just the first name, last name, email address from the form data that was submitted. So let’s take a look at how the data passes from one step to another step in the Power Automate Workflow.
Here is my workflow here, and that’s the last invocation of the workflow. And if I see here, this is the “HTTP request is received”. Then I do a Get DoR Object which has these four elements, file name, data, content type and size. I get the document of record URI from that object here and this is how it looks like. Then I get the actual document of record from the DoR URI and this is how it looks like which has the content type and the actual content here. Then, I can simply use that content type in my email attachment component here. And then the following other, the rest of the steps are the same that we went through in the previous video, which extract the data elements like the first name and the email from the submitted data. And we use it in our email attachment component. So, this is how you can easily extract the document of record from the submitted data and include it in your email attachment. -