• Documentation
  • Workato Blog
  • Product Blog
  • Return to Workato
  • Login
  • Automation Institute
  • Documentation
  • Community Forums
New Topic
Discussions Recipe Building Recipe Error Troubleshooting
S

Saul Macht

started a topic about 6 years ago
Answered

PDF file from Google Drive

I want to upload PDF files from my drive to Salesforce. I tried to use the action from Utilities to Download a file from URL, then Create an Attachment in Salesforce to upload the file. 


The file gets uploaded but the PDF file does not open or load correctly. 


Best Answer
A
Amanda Wong said about 6 years ago

To download file from url using utilities, you need a publicly accessible URL to your file. Few things you need to do,


1) Ensure sharing settings of your google drive file is set to either of below


image


2) Obtain the direct URL of the google drive file as input URL in required field for action


Two ways to do this:


1) Retrieve Web content link of your file

  • Should work for any file type
  • Use recipe action in Google Drive to Search for file or folder e.g. search for file by name (name can be contained in data pill)
  • image
  • Web content link of file will appear in the app data output tree in a following step. You can use it to map into the URL required field
  • image



2) Rewrite URL to correct format

  • The correct format for direct links to PDF files on google drive is: https://drive.google.com/uc?export=download&id=FILE_ID 
  • FILE_ID refers to the string ID in your file URL e.g. 

    image

  • If you have your file ID in a data pill, you can combine it with the default front portion of the url using formula mode, into a complete, valid url as below
    image


Note: Ensure that you select Yes for Base64 encoding as that is required for creating attachments in Salesforce



These should ensure that your PDF gets uploaded correctly onto Salesforce.


Answer

Amanda Wong

said about 6 years ago

To download file from url using utilities, you need a publicly accessible URL to your file. Few things you need to do,


1) Ensure sharing settings of your google drive file is set to either of below


image


2) Obtain the direct URL of the google drive file as input URL in required field for action


Two ways to do this:


1) Retrieve Web content link of your file

  • Should work for any file type
  • Use recipe action in Google Drive to Search for file or folder e.g. search for file by name (name can be contained in data pill)
  • image
  • Web content link of file will appear in the app data output tree in a following step. You can use it to map into the URL required field
  • image



2) Rewrite URL to correct format

  • The correct format for direct links to PDF files on google drive is: https://drive.google.com/uc?export=download&id=FILE_ID 
  • FILE_ID refers to the string ID in your file URL e.g. 

    image

  • If you have your file ID in a data pill, you can combine it with the default front portion of the url using formula mode, into a complete, valid url as below
    image


Note: Ensure that you select Yes for Base64 encoding as that is required for creating attachments in Salesforce



These should ensure that your PDF gets uploaded correctly onto Salesforce.


Login to post a comment

Still can't find your solution?

Send us a ticket, we will try our best to assist you with your problem

Documentation
Developer's Library
Tutorials
eBooks
Product Hour
Product Blog
Workato Blog
Product updates
Customer Stories
© Workato 2022   Privacy   Terms   +1 (844) 469-6752
  • Documentation
  • Workato Blog
  • Product Blog
  • Solutions
  • Forums
  • Tickets
  • Log in
  • Return to Workato
Topic views count