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 / Invalid Character erro...
Power Automate
Unanswered

Invalid Character error when converting 'documentbody' field of Notes entity using base64ToBinary() function

(0) ShareShare
ReportReport
Posted on by Microsoft Employee

We have used base64ToBinary() so as to avoid attachment corruption.
It was working fine till 17th of April 21, but suddenly now its throwing error and not able to create notes.

 

Error Message:

"error": {
"code": "0x80040278",
"message": "Invalid character in field 'documentbody': '\u001a', hexadecimal value 0x1A, is an invalid character.",
"@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionSourceKey": "Plugin/Microsoft.Crm.ObjectModel.AnnotationService",
"@Microsoft.PowerApps.CDS.ErrorDetails.ApiStepKey": "753b8615-ecd8-db11-b397-0019b9204da9",
"@Microsoft.PowerApps.CDS.ErrorDetails.ApiDepthKey": "1",
"@Microsoft.PowerApps.CDS.ErrorDetails.ApiActivityIdKey": "a59d9bba-9b9b-48e2-a439-63fb63d3e1b1",
"@Microsoft.PowerApps.CDS.ErrorDetails.ApiPluginSolutionNameKey": "System",
"@Microsoft.PowerApps.CDS.ErrorDetails.ApiStepSolutionNameKey": "System",
"@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionCategory": "ClientError",
"@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionMesageName": "InvalidCharactersInField",
"@Microsoft.PowerApps.CDS.ErrorDetails.ApiExceptionHttpStatusCode": "400",
"@Microsoft.PowerApps.CDS.InnerError.Message": "Invalid character in field 'documentbody': '\u001a', hexadecimal value 0x1A, is an invalid character."
}

 

Flow in edit mode:

v-pancpr_0-1618814143659.png

Any Leads why is this happening all of sudden? Were any updates pushed?

Categories:
  • rw_ga Profile Picture
    137 on at

    I ran across your post while researching a similar error.  Not sure if it will help you, but other information I ran across indicated you should use base64() to store files on NOTES.  In my case, I no longer get the invalid hex error, but the PDF file won't open when accessed.  information from:  https://powerusers.microsoft.com/t5/Connecting-To-Data/Issue-to-save-a-pdf-to-notes/td-p/531862 

     

    I'm using Adobe's convert word to PDF, encrypt, and then attaching that to a note.

  • rw_ga Profile Picture
    137 on at

    Okay, I think I got my issue resolved/workaround.  Again this appears to be an issue with using Adobe Tools to Convert Word to PDF, Protect PDF from Copying - Editing and Printing, Attach to a Note (Dataverse).

     

    I had to use the following expression so that the file would open after it gets attached to the Note:  

    decodeBase64(base64(outputs('Protect_PDF_from_Copying,_Editing_and_Printing')?['body/fileContent']))
     
    I also attach this file to an email 'Send an email (V2)' and have to use the following expression so that it opens correctly:  base64ToBinary(outputs('Protect_PDF_from_Copying,_Editing_and_Printing')?['body/fileContent'])
     
    Hope this helps anyone else running into this issue.
  • Gabriel Barreto Profeta Profile Picture
    4 on at

    @rw_ga , Thank you very much, you saved me from having to write several lines of code. As much as I still don't understand why I have to convert twice, but it worked, that's what matters.

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

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 349 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 308

Last 30 days Overall leaderboard