Skip to main content
Participant
December 12, 2024
Question

I need to extract form field names and all possible values.

  • December 12, 2024
  • 2 replies
  • 1015 views

I have fillable PDFs for a project. But through piloting, we made changes to the forms. To make sense of the data, I need to compare all of the fields and their related response options (I have several drop-down fields) across all versions of the form. I have lots of versions, so comparing one form to the next manually is going to take forever. I've tried using python to extract all of this, but I can't seem to get it to work the way I need it to. I know how to extract data from the form, or extract the field names by merging to an Excel file. I don't just need the option that's selected in the form, I need ALL of the possible options. I feel like this should be a built-in tool. Can anyone help, please?

This topic has been closed for replies.

2 replies

JR Boulay
Community Expert
Community Expert
December 13, 2024

The FORMREPORT plugin which is part of the (free) abracadabraTools* was made for you.

Enjoy: https://www.abracadabrapdf.net/?p=972

 

 

It returns a row for each field and 45 columns of datas.

 

* Requires the old UI, does not (yet) work with the new Acrobat experience.

Acrobate du PDF, InDesigner et Photoshopographe
PDF Automation Station
Community Expert
Community Expert
December 13, 2024

Nice!

PDF Automation Station
Community Expert
Community Expert
December 13, 2024

What do you mean by "ALL of the possible options"?

Participant
December 13, 2024

I mean, if I have a drop down menu that has ten response options, then in the file I'm trying to create, I need to know what all ten possible options are, not just the first option (which in my forms is "Select"). 

PDF Automation Station
Community Expert
Community Expert
December 13, 2024

Use this function:

function DDItems(dd)
{
if(dd.type=="combobox")
{
var options="";
for(var i=0;i<dd.numItems;i++)
{
options+=dd.getItemAt(i,false)+"\n";
}
return options
}
}

Assuming the field is called "Dropdown",  call the function like this:

DDItems(this.getField("Dropdown"))

The false in dd.getItemAt(i,false) means there are no separate export values.  If there are and you want the display names and the export values you would change that line to something like:

options+=dd.getItemAt(i,false)+":"+dd.getItemAt(i,true)+"\n";