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

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / File content conversio...
Power Automate
Answered

File content conversion creates unreadable word file: uploading file with CDS connector and attaching as a Note in Dynamics 365 CRM

(0) ShareShare
ReportReport
Posted on by 32

Hello, 

 

I was trying to see if I could use the CDS trigger "When a record is selected" to have the user upload a file as a word document, do some things with the file, and then attach the file as a note on a Dyanmics 365 entity. I have created a siple flow to see if this is possible as below:

snip1.png

 

base64(triggerBody()['file']['contentBytes'])

I used the base64 conversion. This flow will attach the file as a note, but the word document is unreadable and will not open:

snip3.png

 

Here is what it looks like after I test the flow:

snip2.png

 

Does anyone know why this is not working? Is there a special conversion needed for contentBytes?

 

Thanks!

Categories:
I have the same question (0)
  • v-bacao-msft Profile Picture
    Microsoft Employee on at

     

    Hi @sarahmcd9000 ,

     

    You could try to change base64() function to base64ToBinary() function.

     

    Best Regards,

  • sarahmcd9000 Profile Picture
    32 on at

    Thanks, I tried that already. Both of the expressions below give the error:

     

    "The field 'documentbody' contains one or more invalid characters."

     

     

    base64ToBinary(triggerBody()['file']['contentBytes'])

    base64ToString(triggerBody()['file']['contentBytes'])

     

     

     
  • Verified answer
    sarahmcd9000 Profile Picture
    32 on at

    I just tried this and it works:

     

    string(triggerBody()['file']['contentBytes'])

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Users!

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
David_MA Profile Picture

David_MA 62 Super User 2026 Season 1

#2
Haque Profile Picture

Haque 58

#3
Expiscornovus Profile Picture

Expiscornovus 39 Most Valuable Professional

Last 30 days Overall leaderboard