Public Forms Dynamics Documents

Hi,

I'm trying to pass an attachment added to a public form through to Dynamics 365 as a document on a note.

I'm able to create a record in our custom module in Dynamics, and add a note to this record. What I'm having issues with however is adding the uploaded document to this note.

I assume the process will be similar to what is document here (https://plumsail.com/docs/forms-web/how-to/email.html#adding-attachments-to-email) with regards to getting the document, but how do I then pass the document through Dynamics?

thanks

Dear @mattforrestxar,
Shouldn't be too hard. Use Dynamics 365 Create Record action and pass the content of the attachments inside of Document property - https://crmtipoftheday.com/1152/attachments-to-dynamics-365-notes/

Thanks @Nikita_Kurguzov,
I did come across this article, but I've had no success unfortunately.
I've tried to encode the body element as base64, but this throws an error message.

regards
Matt

Dear @mattforrestxar,
Please, use the same action and the same everything, but try not to wrap body inside of base64(...) - it should already be in this format and work fine as is! If not - let me know, and show an error, please.

Hi @Nikita_Kurguzov ,

Below is the flow,

Which errors and I get this;

thanks
Matt

Dear Matt,
I think you're doing it correctly, but still need to add ['$content'] after body('HTTP'), like this:

body('HTTP')['$content']

This is because you have $content-type and $content from your HTTP request inside Body:
image

Some progress :grinning:
The flow runs successfully, and I see the file on the note.

image

However when I try to open the file I get an error thrown.

image

thanks
Matt

Dear @mattforrestxar,
What does Show Details show?
image

Ah sorry @Nikita_Kurguzov that might have helped!

Below is under Show Details

Error code: 0x80040315
Session Id: b3574db4-b1a5-4fb2-866a-6c671a8382b0
Activity Id: 53a0b116-23cc-4088-8018-406df7e3da56
Time: Tue Dec 22 2020 16:01:18 GMT+0000 (Greenwich Mean Time)

Dear @mattforrestxar,
Okay, and if you try to wrap body('HTTP')['$content'] inside of base64(...) - would this make any difference?

Try it like this:

base64(body('HTTP')['$content'])

Hi @Nikita_Kurguzov,

Thank you for the help with this, I've tried again with body('HTTP')['$content'] and this worked, so not sure why this wasn't working when testing the other week.

thanks
Matt

1 Like