Skip to main content
logistics227043683
Known Participant
March 7, 2019
Answered

How to send PDF form field data to a google spreadsheet

  • March 7, 2019
  • 6 replies
  • 23031 views

Good evening, I am wondering if it is possible to send PDF data to the google spreadsheets? We are trying to find a way to automatically update our spreadsheets after our local program gets finished processing our customers. Thank you!

This topic has been closed for replies.
Correct answer Thom Parker

So a submit from a PDF sends an HTTP Post to a server.  This is exactly how an HTML form works. So the technique is to create a Google form with exactly the same field names as the PDF form, then create a Google sheet for this form. All automated on the Google side. Then take a look at the what the form submit is doing from the Google form. Use the same submit URL in your PDF submit. Of course the PDF submit action will need to be set to HTML.

6 replies

New Participant
January 20, 2024

Has anyone come up with an answer on this? I am trying to do exactly this but have no idea how to come up with the url or how to do it. Or even how to ask someone to do it for me.  

 

I looked at the code for teh submit button but when I use that i must have some wrong code or something because it returns an error message

 

New Participant
February 16, 2023

So, I was able to create the HTML form to submit data into Google Sheets via Google Forms.  I tried this same setup for an Adobe form but I get an Authorization Error Code.  I have the correct post URL, form names are the same, and have the HTML export option.  Any help would be greatly appreciated.    

New Participant
October 1, 2021

I have been working on this problem for over an hour and it's simply not working.  Like another commentor, I can get the form to see a new response, but it's completely blank.  Also, it's not updating the spreadsheet.

Instead of just "use the URL that the Google Form uses", can someone point out exacly what URL I should be using?  It changes twice during the submission process.... which one is it?  I've tried all of them, as far as I know, and none of them do what I want them to do.

New Participant
January 8, 2022

were you able to figure out which URL to use?

New Participant
October 20, 2022

Sorry to revive an old thread, but this is truly the only resource that I could find on this topic as well. 

I am able to write a URL that successfully adds data to my Google Sheet.

https://docs.google.com/forms/d/e/[FORM ID] /formResponse?usp=pp_url&entry.1815784337=test

However, when I try to submit the data from my .PDF, I only get a timestamped entry in the Google Sheet without accompanying data.

I have set my the name of the form field to "1815784337" as well as "entry.1815784337" without success. I have tried multiple URLs in the submit options, including:
https://docs.google.com/forms/d/e/[FORM ID] /formResponse?usp=pp_url&
https://docs.google.com/forms/d/e/[FORM ID] /formResponse

What am I missing here? I don't have a ton of coding savvy, but I assume that this POST request works by breaking the URL into two parts (one is the URL that I enter into Acrobat, and the other is the field name), but maybe I'm dividing it in the wrong place / writing the base URL wrong? I can't find any documentation indicating the syntax of the POST request coming from Acrobat.

Does this make any sense? Any assistance would be greatly appreciated.

Participating Frequently
December 29, 2020

Do I have to host the pdf on a server or can it be on my local desktop? I followed the steps. I created the Google Form that links to the Google Sheet. Then, I got the field names using the Prefillable link and have the correct url. Then I created the submit button and set it to HTML and the action is mouse up > submit form. I keep getting general error. Nothing populates into my sheet. Any advice? Thanks

New Participant
June 8, 2020

Good morning, has a solution been created for this process? I tried creating this same process for our internal use and receive an error message trying to utilize "Run a JavaScript" and it does not fill the fields but renders a timestamp in the google spreadsheet. "Submit a form" does send all the fields to the google sheet but a similar error message appears. Thom would you have any suggestions on how I can get a thank you page, or message to generate instead of the error message?

Thom Parker
Community Expert
September 7, 2020

Sorry for the late reply.  I missed the message.

What is the exact error?

 

I think what you may be seeing is Acrobat responding to the HTTP Responce from Google.  Acrobat doesn't know how to handle it. It's been a while since I've worked with this so I'm not sure of the details. However, I do believe there is a way through the Google services to customize the response in a way that Acrobat does understand.  To do this you'll need to write some custom JS on the Google side. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
Participating Frequently
March 30, 2022

I'm having...odd issues...I have a Google Form and Sheet. I've copied the field IDs using Get Prefilled link. I'm trying to get this to work with a short form - 6 fields...text, integers, and a date. I'm up to about a dozen trials submitting it. When I submit I always get a timestamp but only the first field (L Name). In Acrobat, the fields are named "entry.xxxxxxxxx" - matching what I get from the prefilled link. In the prefilled link the reference is: "entry.498728576=Weasley&entry.238933929=Fred&entry.672957676=2011-11-11..." I tried entering the ampersand both before the second field and after the first field. I received a General Error. After removing the ampersand fields 1 and 2 were sent to the Sheet???? Did not make sense, but I tried that with field 3 with no positive result.

 

When all 6 fields in Acrobat are named "entry.xxxxxxxxx" I get a General Error message.

 

What am I missing?

Thom Parker
Community Expert
March 8, 2019

Yes, you do it in exactly the same way a Google Form sends data to a Google Sheet. 

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
logistics227043683
Known Participant
March 8, 2019

Interesting, thank you for your reply! Do you mind if you can link to me some resources, ot the general steps in doing so?

Thom Parker
Thom ParkerCorrect answer
Community Expert
March 8, 2019

So a submit from a PDF sends an HTTP Post to a server.  This is exactly how an HTML form works. So the technique is to create a Google form with exactly the same field names as the PDF form, then create a Google sheet for this form. All automated on the Google side. Then take a look at the what the form submit is doing from the Google form. Use the same submit URL in your PDF submit. Of course the PDF submit action will need to be set to HTML.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often