Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

Insert PDF file in image field of custom entity record using Microsoft Flow

(0) ShareShare
ReportReport
Posted on by
Requirement Background,
> Have invoice file (PDF) visible/downloadable for Customer portal users.
> Customer portal users are managed by Dynamics CRM online.
> So we have a MS flow to read the PDF files from an SFTP location and post it into respective folder path Sharepoint.
> But the CRM wasn't able to access that file path in Sharepoint and also we weren't able to figure the impersonation needed for the CRM user to fetch from Sharepoint.
What we are trying to do now is...
> To have MS flow write to Sharepoint as well as insert a record in Dynamics CRM Online custom entity having the file in binary format.
Problem,
The SFTP output body is not accepted as a valid input to the binary (Image) field in the CRM.
We tried Base64ToBinary, simply mapping the SFTP body/content to the field, etc. etc.
Nothing works and we keep getting 400, BadRequest, Invalid Argument errors.
Please help.

*This post is locked for comments

  • Suggested answer
    RaviKashyap Profile Picture
    55,410 Moderator on at
    RE: Insert PDF file in image field of custom entity record using Microsoft Flow

    Hi,

    You can try uploading it to a note record for the custom entity. Notes has the document body field which accepts byte array.

    docs.microsoft.com/.../sample-upload-retrieve-download-attachment

    Hope this helps.

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

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Leaderboard > Microsoft Dynamics CRM (Archived)

#1
Mohamed Amine Mahmoudi Profile Picture

Mohamed Amine Mahmoudi 83 Super User 2025 Season 1

#2
Community Member Profile Picture

Community Member 52

#3
Victor Onyebuchi Profile Picture

Victor Onyebuchi 6

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans