Skip to main content

Notifications

Announcements

No record found.

Customer experience | Sales, Customer Insights,...
Answered

Can't Create Note with jpg image attached from microsoft flow

Posted on by 35

Hi, 

I've created a flow in PowerApps that gets from Onedrive directory a list of images in jpg format.

Then searches for a product code, and then creates a note with the image from onedrive attached.

But when is creating the note it gives this error: The 'inputs.parameters' of workflow operation 'Create_a_new_record_2' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/documentbody' is required to be of type 'String/bytes'. The source type/format 'String/binary' of the value

I'm getting the image with a Get file content using path

pastedimage1591730896777v1.png

And a set variable to set the image in the create new record this way

pastedimage1591730935845v2.png

Does anyone know how to do or solve this?

Best regards!

  • RE: Can't Create Note with jpg image attached from microsoft flow

    Oh thanks!!

    It worked just fine!

    Why do I need to use File Content as an array?

    --> Content: add "[ File Content ]"

    Thanks!!!

  • Verified answer
    H V Profile Picture
    H V 347 on at
    RE: Can't Create Note with jpg image attached from microsoft flow

    Hi,

    Please follow below steps to create notes into Dynamics 365 from OneDrive:

    Step 1: Get File Content(One Drive)

    7041.png

    Step 2: Select Parse JSON

    - Content: add "[ File Content "

    - Schema: Click on 'Generate from Sample' and add below code.

    [{
      "$content-type": "image/jpeg",
      "$content": "Test Content"
    }]

    6758.png

    Step 3: Create a note record

    - Document: Select $content

    - Mime Type: $Scope-type

    4666.png

    Hope this helps!

  • RE: Can't Create Note with jpg image attached from microsoft flow

    Hi,

    Thanks for your answer!

    I've changed the variable to be a string, and pass the file content with base64

    base64(outputs('Get_file_content_using_path')?['body'])
    pastedimage1591796768137v1.png
    pastedimage1591796806122v2.png

    but when is creating the Note record I'm getting this error:

    "Invalid character in field 'documentbody': '.', hexadecimal value 0x00, is an invalid character.",
    IF instead of passing base64ToString I pass just the variable I've setted before I'm getting this error:
    pastedimage1591796941060v3.png
    The 'inputs.parameters' of workflow operation 'Create_a_new_record_2' of type 'OpenApiConnection' is not valid. Error details: Input parameter 'item/documentbody' is required to be of type 'String/bytes'. The source type/format 'String/base64-function-result' of the value

    Thanks for your help!

  • Suggested answer
    Bipin D365 Profile Picture
    Bipin D365 28,964 Super User 2024 Season 1 on at
    RE: Can't Create Note with jpg image attached from microsoft flow

    Hi,

    Instead of directly passing content to document body, you will have to convert to base64 string.

    Please find below function in microsoft which will help you do the same.

    docs.microsoft.com/.../workflow-definition-language-functions-reference

    Also look at flow community thread below.

    powerusers.microsoft.com/.../280333

    Please mark my answer verified if I were helpful!

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans