Sending data from pdf forms to excel upon submission!
Copy link to clipboard
Copied
Hi, is it possible to export data from entries made on a pdf form to an excel spreadsheet when it is submitted?
My department uses standalone pdf forms that are used by individuals around the country to report their findings from audits they have done. The form has a submit button that emails a copy to the area office.
What I want to know, is it possible to send data from certain fields on the form (using javascript) to a central excel spreadsheet using the submit function as the trigger event? Or, and this might be a bit of a stretch, to a sharepoint list?
Ive been looking around on the internet for a couple of days and found plenty for importing into excel and csv files, or multiple files at once into excel, but cant find anything that fits what I'm trying to do. Maybe because it cant be done, but I remain optimistic and sure somebody will know how.
All input and advice is greatly appreciated. Thanks in advance.
Copy link to clipboard
Copied
The answer is yes and no. There are many different ways to move data in and out of PDF forms to various data storage formats/systems, including Excel. But the description of your desired workflow is a bit muddled. You say that people in remote locations use an existing submit button to email the PDF to a central location? Do you then want the recieving email application to move data from the PDF attached to the email into an Excel Spreadsheet?
This is entirely possible. For example MS Outlook can be programmed with VBA to extract data from the PDF and place it in Excel. But this doesn't really have anything to do with Acrobat or Acrobat Scripting. And there are better ways to do this.
To get a handle on the process, each stage of the process needs to be examined. For example, when the reomote user submits the PDF. Acrobat either uses the local email client on that machine to send the PDF as an attachment, or it may connect directly to an email server to perform this task directly. That email goes through a series of servers where it is eventually routed to the destination email server. At some point after this time, an email client on a computer at the main office contacts the email server and uploads the latest emails.
At what point in this process is extracting data best for your workflow? What is the best data format for this type of data transfer?
I'm assuming that you are using Acrobat/PDF, email, desktop client email apps, and excel because these are convenient and you know how to use them. But managing data from multiple remote sources is complex. You are trying to handle a remote distributed process with local desktop apps. This can be done, but it has to be carefully thought out, and one or more custom connectors needs to be developed.
I would suggest two things:
1) Submit the PDF Data from the remote users in an easily handled format, such as XML. This way Acrobat is only used on the front end, and is not needed past this point.
2) Use MS Outlook as the local email client on the recieveing end. There are features in Outlook for sorting email. Use these in combination with a custom VBA script to automatically move data from the email attachment into Excel.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Hi Thom,
Thank you for your reply, sorry for the delay in responding, I've just come back from annual leave.
Apologies for not making things clearer, just to give better explanation (hopefully);
Enforcement examiners will conduct an investigation at an operators premises and complete a pdf form to record their findings, the blank forms are available to download from the agencies SharePoint site or are held locally on examiners laptops. When ca spreaomplete, they are uploaded to a central case file system by the examiner where only the people involved in the case have access to the report. The reports are not linked to anything and, as I refer to them, are a standalone or isolated report.
The submit button I mentioned presently does nothing more than attaching a copy of the report to an email (using outlook) and sending it to the company directors named in the report.
What I have been asked to do is to look at ways to pull information from the standalone reports to start collecting statistics. My thinking was to have a procedure that can use the submit button as the trigger event to run a process.
Ideally, that process will send the data to a central Excel spreadsheet on SharePoint that updates automatically, but I’m not sure if that is possible from the pdf form!
Or, create a pdf, or spreadsheet, with a table containing just the required data that is then saved to a folder in SharePoint where I can then import the individual files into Excel on mass. I have read that this is possible with a pdf but I'm unsure of where to start and how to collect the relevant data from the original form and then create a pdf to save independantly.
I hope this clarifies what I am trying to do a little better?
Can, whichever data file is created, be saved directly to a folder on a SharePoint site as opposed to being sent as an email attachment?
If these are feasible options do you have any advice or samples of script or code that is close to what I need to give me a starting point.
Sorry if none of this makes any sense, I'm fairly new to this and don’t really know what is possible and what isnt in the world of pdf's, and although I can get by with VBA I'm just learning JavaScript.
Many thanks,
Shaun
Copy link to clipboard
Copied
More clarification is needed.
1) Is the data extracted from the PDF file that is recieved by the company directors, i.e. on the recieving end of the email?
Or is it extracted from the PDF that is submitted from? If this is the case then the email submit is irrelevant, and a diversion that wasted time.
2) On what kind of device is the PDF being viewed when the submit button is pressed. Is it a mobile device or a desktop?
3) Where is the Exel file located? Is it local to the computer where the PDF is submitted? Or is it remote?
I think I mentioned that it is important to understand the details of the parts of the workflow. Where are they located? how do they communicate? If the Excel file is managed by sharepoint, then perhaps this is a SharePoint, and not an Acrobat issue. For example, the "submit" button could submit raw form data to the SharePoint server. So no PDF involved at that point, and inserting the data into the Excel file is sharpoint's problem.
You are asking way too much from a free forum. You really need to hire a cousultant.
Use the Acrobat JavaScript Reference early and often

