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 / Issues in file upload ...
Power Automate
Unanswered

Issues in file upload to salesforce - File is getting created but in salesforce it is showing 'No preview available'

(1) ShareShare
ReportReport
Posted on by 8

I am trying to upload a SharePoint pdf file in salesforce via Power Automate desktop flow.

Steps I followed-

1. I used Get file content SharePoint action to read a file. 

2. Compose action- In the "Inputs" field of the Compose action, I entered base64(body('Get_file_content')) 

3. Create record salesforce action- used the base64 content in the "Create a file" action in Salesforce.

 

File is getting created in Salesforce but it's not readable. Showing 'No preview available'

 

SagarKusekar96_0-1715948577047.png

SagarKusekar96_1-1715948637374.png

 

Need your valuable inputs.

 

Categories:
I have the same question (0)
  • jmin Profile Picture
    9 on at

    I'm having the same issue. The file content that gets uploaded to Salesforce is the base64 string. It seems like Salesforce fails to convert the base64 string back to binary upon insert of the record. When using the REST API's, I dont face this issue, but I seem to be facing this issue with the "Create Record" action in Power Automate.

     

     

    Also separate unrelated note. I'm seeing you're inserting a ContentVersion record, then a ContentDocumentLink. You can simplify that into one step by using the First Publish Location ID field when inserting the ContentVersion record. 

  • DanHardy Profile Picture
    on at

    I'm having the same issue to.  @jmin did you use a http post in Power Automate to create a ContentVersion instead of the Create Record action?  If so, would you mind sharing how you did that.

  • jmin Profile Picture
    9 on at

    @DanHardy @SagarKusekar96 

     

    I forgot to follow up on this, but I was able to resolve this.

     

    First, use "Get file content using path" instead of "Get file content". For some reason, "Get file content" always results in a corrupt file being generated. I think it's an issue that Microsoft needs to resolve.

     

    Second, when inserting ContentVersion, you can just put the "File content" variable from "Get file content using path" in the Version Data field. No need to do any data manipulations like converting to base64. 

     

    Let me know if this helps or if you have questions.

     

    jmin_1-1718308002314.png

     

  • DanHardy Profile Picture
    on at

    @jmin Thanks for your help!  Using your instructions, I was able to upload the file ok to Salesforce, but it's not being recognized as a pdf file either in preview mode, or if I download it.  Any ideas?  Here are my settings:

    DanHardy_0-1718310031265.png

    DanHardy_4-1718310182530.png

     

    Not being recognized as a pdf

    DanHardy_3-1718310143865.png

     

  • jmin Profile Picture
    9 on at

    @DanHardy

     

    Salesforce has some quirks in how it determines content type.

     

    Within the Path on Client field, you'll need to make sure it ends with the appropriate file extension (i.e. .pdf). Can you try adding .pdf to the end of that variable?

  • DanHardy Profile Picture
    on at

    do you mean the title variable?

  • jmin Profile Picture
    9 on at

    This one should end in .pdf

     

    jmin_0-1718310812153.png

     

  • DanHardy Profile Picture
    on at

    This is what I got when I did that. 

    DanHardy_0-1718311088217.png

     

  • SagarKusekar96 Profile Picture
    8 on at

    Hey all,

    I found a way to fix this issue. It's a bug in new designer. You can try by using legacy designer, disable new designer and try to test. I will work in your case.

     

    Thank you.

  • DanHardy Profile Picture
    on at

    Sagar- You are amazing!  That worked!!  Thank you.

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…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard