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 / Issue to save a pdf to...
Power Automate
Unanswered

Issue to save a pdf to notes

(0) ShareShare
ReportReport
Posted on by 5

Hello
I builded a flow in Sandbox wich should convert a html into a pdf and then save it into Dynamics 365 notes. It worked fine and as it should. After that I recreated it in the dev-system of the customer, the html creation and convert of this file works perfect, but saving into CRM doesn't.

It throws following error while saving changes to the flow (CDS-Connector is used):

 

Request to XRM API failed with error: 'Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Fehler beim Speichern des Flows. Code: OpenApiOperationParameterValidationFailed, Meldung: \"Input parameter 'item' validation failed in workflow operation 'Create_a_new_record': The parameter with value '\"@outputs('Get_file_content')?['body']\"' in path 'item/documentbody' with type/format 'String/binary' is not convertible to type/format 'String/bytes'.\"."}}". Code: 0x80060467 InnerError: Type: System.ServiceModel.FaultException`1[[Microsoft.Xrm.Sdk.OrganizationServiceFault, Microsoft.Xrm.Sdk, Version=9.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35]] Message: Flow client error returned with status code "BadRequest" and details "{"error":{"code":"InvalidOpenApiFlow","message":"Fehler beim Speichern des Flows. Code: OpenApiOperationParameterValidationFailed, Meldung: \"Input parameter 'item' validation failed in workflow operation 'Create_a_new_record': The parameter with value '\"@outputs('Get_file_content')?['body']\"' in path 'item/documentbody' with type/format 'String/binary' is not convertible to type/format 'String/bytes'.\"."}}". StackTrace: at Microsoft.Crm.Extensibility.OrganizationSdkServiceInternal.Update(Entity entity, InvocationContext invocationContext, CallerOriginToken callerOriginToken, WebServiceType serviceType, Boolean checkAdminMode, Boolean checkForOptimisticConcurrency, Dictionary`2 optionalParameters) at Microsoft.Crm.Extensibility.OData.CrmODataExecutionContext.Update(Entity entity, UpdateOption updateOption) at Microsoft.Crm.Extensibility.OData.CrmODataServiceDataProvider.UpdateEdmEntity(CrmODataExecutionContext context, String edmEntityName, String entityKeyValue, EdmEntityObject entityObject) at Microsoft.Crm.Extensibility.OData.EntityController.PatchEntityImplementation(String& entityName, String key, EdmEntityObject entityDelta) at Microsoft.PowerApps.CoreFramework.ActivityLoggerExtensions.Execute[TResult](ILogger logger, EventId eventId, ActivityType activityType, Func`1 func, IEnumerable`1 additionalCustomProperties) at Microsoft.Xrm.Telemetry.XrmTelemetryExtensions.Execute[TResult](ILogger logger, XrmTelemetryActivityType activityType, Func`1 func) at lambda_method(Closure , Object , Object[] ) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ActionExecutor.<>c__DisplayClass10.<GetExecutor>b__9(Object instance, Object[] methodParameters) at System.Web.Http.Controllers.ReflectedHttpActionDescriptor.ExecuteAsync(HttpControllerContext controllerContext, IDictionary`2 arguments, CancellationToken cancellationToken) --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ApiControllerActionInvoker.<InvokeActionAsyncCore>d__0.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Controllers.ActionFilterResult.<ExecuteAsync>d__2.MoveNext() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at System.Web.Http.Dispatcher.HttpControllerDispatcher.<SendAsync>d__1.MoveNext() InternalException: '.

 

and the following error while saving the PDF to the notest (Dynamics 365 Connector):

Invalid character in field 'documentbody': '
', hexadecimal value 0x0C, is an invalid character.

 
 

 

Categories:
I have the same question (0)
  • yashag2255 Profile Picture
    24,769 Super User 2024 Season 1 on at

    Hi @noahvoe 

     

    Can you share a screenshot of the error that you are seeing? Can you check after the convert to PDF action, when you are creating the file in the notes for CDS, can you try wrapping the pdf content in a binary function? 

     

    Hope this Helps!

     

    If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!

  • GuravaReddy Profile Picture
    56 on at

    Hi All,

     

    I am also getting same error message. 

    It works fine till last week and suddenly it is throwing error message .

     

    Now , flow is not able to create a note with attachment in D365 CE. In my case, flow is converting word to pdf and creating a note with attachment in D365 CE.  

     

    Error : Invalid character in field 'documentbody': '', hexadecimal value 0x14, is an invalid character.

     

    SC16.png

     

    I tried below scenario to test the issue but getting same error message 

    • Read sample pdf file (Data in pdf : Test flow pdf data) from SharePoint
    • Create Note with Attachment .

     

    SC18.png

    SC17.png

     

    Regards,

    Greddy 

     

     

  • noahvoe Profile Picture
    5 on at

    Hi @GReddy 

     

    We couldn't solve the problem, but it wasn't a really necessary feature, it would just be nice feature to have.

    If we find a solution in the future I'll post it here.

     

    Please inform us if you have solution for the problem.

     

    Regards 

     

    Noah

  • GuravaReddy Profile Picture
    56 on at

    @Noah,

     

    MS support is suggested below option in my scenario and its working fine. 

     

    if I use file content directly in flow system throws an error message .

    1.png

    so they suggested to  use base64 function to convert file content and its working now.

    base64(outputs('Get_file_content_using_path_FAQ')?['body'])

    2.png

     

    Regards,

    Greddy

     

     

     

  • Community Power Platform Member Profile Picture
    on at

    base64() solves the issue of bypassing the error but when you open the pdf from the notes it fails to open

    ssanthosh94_0-1629397407542.png

     

  • Aedu Profile Picture
    107 on at

    Hi

    We just struggle over the same problem. Did you find a solution?

  • Bruce Buxton - North52 Profile Picture
    4 on at

    I found that I had to decode the value then re-encode it!

     

    decodeBase64(base64(outputs('Generate_document_from_Word_template')?['body/fileContent']))

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…

Kudos to our 2025 Community Spotlight Honorees

Congratulations to our 2025 community superstars!

Leaderboard > Power Automate

#1
trice602 Profile Picture

trice602 307 Super User 2026 Season 1

#2
David_MA Profile Picture

David_MA 269 Super User 2026 Season 1

#3
Power Platform 1919 Profile Picture

Power Platform 1919 115 Super User 2026 Season 1

Last 30 days Overall leaderboard