web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Get File Content for D...
Power Automate
Unanswered

Get File Content for Dataverse Note to Upload to Business Central

(0) ShareShare
ReportReport
Posted on by 55

Hi 🙂 

 

I have a canvas app with Dataverse as my data source. I have enabled the Attachment so all my attachments are stored in Note. In my Power Automate flow for when a record is created I need to get the file name and file content for the attachments and upload them to Business Central. I have an "List rows" action to get the attachments and from there I can get the File Name but I'm not able to use the Document variable (Always get failed to load error if I try to open it in Business Central). Can someone help me out? 

Categories:
I have the same question (0)
  • Linn Zaw Win Profile Picture
    2,996 on at

    What action did you use to upload them to Business Central? Maybe the action is expecting Binary data instead of Base64. In that case, you need to convert the content type before uploading to BC.

    base64ToBinary(outputs('Get_a_Note_Attachment')?['body/documentbody'])

     

     

  • ice1234 Profile Picture
    55 on at

    Hi @LinnZawWin 

     

    I'm using the "Update an image, file or document (V3)" for Business Central. I've tried a few ways to see if the base64tobinary is something I could use, but so far nothing is working. I've tried to take the "Document" variable and append that one to string variable and using that in the base64tobinary, I've also tried the same thing that you suggested here above but that doesn't seem to work either. I'm fairly new to Dataverse so maybe I'm doing something wrong.

     

    I have the same flow for Sharepoint and that one is working perfectly. 

     

    ice1234_0-1688459561332.png

    In a perfect world I thought I could just use the "Document" variable that comes from this action. 

     

  • Linn Zaw Win Profile Picture
    2,996 on at

    @ice1234 

    Sorry, I don't have a Business Central connection to test the Update an image, file or document (V3) action.

    But based on the following blog post, it is getting the file content from Get file content action for the OneDrive for Business connector which is the binary format. So, base64ToBinary() of the Documents should be working but I am not sure why it is not working for your case.

    https://www.powercommunity.com/dynamics-365-business-central-new-power-automate-actions-for-handling-images-and-attachments/

     

    Hope someone who's familiar with BC connector could shed some light.

     

  • ice1234 Profile Picture
    55 on at

    Hi @LinnZawWin,

     

    Yes this works perfectly for Sharepoint as well. But when I'm getting the attachment from Dataverse things seem to get more complicated, maybe I'm not pulling the attachment from Note correctly or missing some step. 

     

    Thank you so much for taking the time to reply to me, I really appreciate it! 

  • Linn Zaw Win Profile Picture
    2,996 on at

    If you are able to upload the file from SharePoint, that means the action is expecting binary data.

    In that case, base64ToBinary should work through.

    Ref: https://linnzawwin.blogspot.com/2021/02/handle-base64-and-binary-file-content.html

     

     

     

  • Verified answer
    ice1234 Profile Picture
    55 on at

    @LinnZawWin,

     

    I figured this out. I needed to use a compose action for the content-type (Mime-Type in Dataverse) and content (Document in Dataverse) and then I was able to use the output as the Content! 🙂 

  • Linn Zaw Win Profile Picture
    2,996 on at

    @ice1234 

    Glad to know that it finally worked out well. Please mark your own last reply as a solution to close this thread. That will be useful for others in the community who come across this thread to identify the solution easily.

     

     

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 538 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 405 Moderator

#3
abm abm Profile Picture

abm abm 252 Most Valuable Professional

Last 30 days Overall leaderboard