cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
SUMIT7817
Regular Visitor

How to read File Content from Model Driven App and Create a Note with attachment

Hi Community

 

Recently i have been trying to work over the a scenario to move a attachment uploaded in File - (data type) of attribute to Notes Entity in Dynamics CRM

 

Steps followed :-

  • Created a Model Drive App
  • Created a new attribute of data type - FILE , added the same on form
  • On Create, i need to move the file attached in attribute to NOTES entity in Dynamics CRM


  • Created a flow 
  • Get the records
  • Get the file Content
  • And on creation of NOTE record with File Content facing Hexadecimal error
  • Tried converting the file content to binary and still facing the issue

 

Error message :-

{
  "error": {
    "code""0x80040278",
    "message""Invalid character in field 'document body': '\u0012', hexadecimal value 0x12, 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""b4fbd92c-a517-4141-8380-1d759052fbc5",
    "@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': '\u0012', hexadecimal value 0x12, is an invalid character."
  }
}

 

Tried converting to BINARY as well as Placing the content directly
PowerAutomate.JPG

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
SUMIT7817
Regular Visitor

Got the solution.. and it works perfectly fine.. 

Just need to convert the file to base64()

View solution in original post

2 REPLIES 2
SUMIT7817
Regular Visitor

Got the solution.. and it works perfectly fine.. 

Just need to convert the file to base64()

Anonymous
Not applicable

After converting file to base64() I get this error when opening the pdf from the notes. Any ideas on why and how to resolve it? 

 

ssanthosh94_0-1629397766712.png

 

Helpful resources

Announcements
Power Automate News & Announcements

Power Automate News & Announcements

Keep up to date with current events and community announcements in the Power Automate community.

Microsoft 365 Conference – December 6-8, 2022

Microsoft 365 Conference – December 6-8, 2022

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.

Power Automate Community Blog

Power Automate Community Blog

Check out the latest Community Blog from the community!

Top Kudoed Authors
Users online (5,501)