file not opening correctly sharepoint Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/tag/file-not-opening-correctly-sharepoint/ Microsoft Dynamics CRM . Microsoft Power Platform Sat, 20 May 2023 14:05:29 +0000 en-US hourly 1 https://wordpress.org/?v=6.6.1 https://i0.wp.com/microsoftdynamics.in/wp-content/uploads/2020/04/cropped-Microsoftdynamics365-blogs.png?fit=32%2C32 file not opening correctly sharepoint Archives - Microsoft Dynamics 365 Blog http://microsoftdynamics.in/tag/file-not-opening-correctly-sharepoint/ 32 32 176351444 SharePoint file created from power automate flow doesn’t show open correctly or corrupted. http://microsoftdynamics.in/2023/05/20/sharepoint-file-created-from-power-automate-flow-doesnt-show-open-correctly-or-corrupted/ Sat, 20 May 2023 13:54:48 +0000 https://microsoftdynamics.in/?p=4704 created a file from a Dynamics 365 CRM record attachment and when I try to load it into SharePoint it doesn’t create or read correctly? Even if it appears to upload correctly, it may not open properly and display something like this: Consider the following scenario. Suppose you have attached a document in SharePoint and...

The post SharePoint file created from power automate flow doesn’t show open correctly or corrupted. appeared first on Microsoft Dynamics 365 Blog.

]]>
created a file from a Dynamics 365 CRM record attachment and when I try to load it into SharePoint it doesn’t create or read correctly?

Even if it appears to upload correctly, it may not open properly and display something like this:

Consider the following scenario. Suppose you have attached a document in SharePoint and want to save it in Notes.

  1. Let’s say you have uploaded this PDF document to Notes and now you want to upload it to SharePoint.
  2. I have a flow that sends this document to SharePoint that runs when I create a note in the Dataverse (Dynamics 365 CRM).”
  3. Now the “Create File” action in SharePoint looks like this:
    This allows the SharePoint file creation action to add the document to the file context. Hovering the mouse over this will result in triggerOutputs()?[`body/documentbody`].
  4. Running this flow creates a document in SharePoint. However, when I open the file, I get an error message that the file cannot be read, even though the file appears to upload correctly.Please click on the link to find correct way to

    Create a file from a Dynamics365 CRM record attachment notes and move to SharePoint documents. without corrupted file.

Use base64ToBinary conversion

Here’s a step to create a File in SharePoint in your mentioned SharePoint library –

  1. In order to correctly pass this through, use the base64ToBinary expression in the Create file’s File Content field.
  2. And in base64ToBinary, put the Document so that it looks like this – “base64ToBinary(triggerOutputs()?[‘body/documentbody’])
  3. And when you re-run the test, the document will be created in the same way.
    And now when you open it, it’ll open properly.

The post SharePoint file created from power automate flow doesn’t show open correctly or corrupted. appeared first on Microsoft Dynamics 365 Blog.

]]>
4704