I'm relatively new to Flow. I've been working on taking attachments in notes and moving them to SharePoint. The flow I have right now is basically:
When record (note) is created > Is [custom entity] > isdocument=true > SharePoint: create file, contents=Document
This creates a new document in SharePoint everytime I attach any file to a note in an entity that I've specified. The problem is, that new file is totally useless. Is there a way I can simply copy the attachment or decode in the Flow to make these files useful to our end users?
Could you show me a screenshot of your flow configuration?
Have you created the file on SharePoint library successfully while you are not able to check it?
Do you get any error when opening the file?
Thanks for the help!
Here's my flow. My trigger is every time a note is created. Then it checks to make sure that the note was created in the entity "Working Events." See the screenshot:
If it passes the first condition, I have it check the not for a document attachment. If it finds that, I have it create a sharepoint document. It names it the date it was created, places it in the "Applications" folder and the document is the contents of the document in the note.
When it runs successfully, the Flow Output looks like this:
So, what I notice right away is that the MediaType is not at all what I would expect. I'm attaching only Word documents to run my tests. When I go to SharePoint I see this file which I'm allowed to download (I've changed the naming scheme since that upload):
So, aside from the non-specific extension and awful name, it's doing pretty much what I want, that is until I try to open the file. When I open the file in Note Pad, it's a base64 document that looks like this:
Obviously just an example of the file. The problem is that Base64 file can't be translated back into a word document, it doesn't translate well to Binary, and I can't figure out any other way to use that output.
Is there any way I can take the document and go from the Note Attachment and put it into the entity record's documents? If I could do that, I can have the Dynamics 365 and SharePoint 365 integration handle the rest. Or if I could somehow pull the document itself instead of the document contents, that would fix this problem as well. The first solution has better naming schemes, but for now I'd take either.
I am working on a similar requirement and think I found all the clues I need in post: https://themscrmexpert.wordpress.com/2019/01/22/use-microsoft-flow-to-move-notes-attachments-from-cr...
Check out the News & Announcements to learn more.
Participate in the Power Virtual Agents Community Challenge
Power Platform release plan for the 2021 release wave 2 describes all new features releasing from October 2021 through March 2022.
DynamicsCon is a FREE, 4 half-day virtual learning experience for 11,000+ Microsoft Business Application users and professionals.