Skip to main content
Inspiring
October 13, 2016
Question

Automating PDF user form

  • October 13, 2016
  • 3 replies
  • 404 views

I have created an enrollment form in InDesign and exported to PDF for additional editing and then future distribution to employees.

One of the field names on the form is "PIN". The intent is that once the user enters the four digit PIN, the form will auto populate certain text fields to show info that pertains to him (info isn't confidential).

I have a data source file in Excel, and have researched how to include the data source file in the PDF file. However, I am wondering how do I tell Acrobat to merge the data based on the user entry of the PIN. Like in Excel, you use an IF statement, but I don't know how to scripting in Acrobat.

If this is done by scripting or some other way, please provide step by step instructions on how to do this.  I am not familiar with how to do JavaScript.

Thanks.

This topic has been closed for replies.

3 replies

Inspiring
October 13, 2016

Thanks so much for the reply. This answer looks great, but just a small problem. While I mentioned the content on the form isn't confidential, I would prefer that each user not able to use the drop down box because they could simply choose any of the choices in the drop down box and see how it populates the form with its applicable content. Employee A could choose Employee B in the drop down and see his stuff. The info isn't confidential, but it would populate current 401k elections and some people may not want others knowing how much they are contributing or that they are not contributing at all.  Potential for embarrassment.

But with the PIN option, others don't know each other's PIN and it wouldn't be a drop down option. It would just be entered at the top of the form and then auto populate other text fields. I would like to use a data source file to merge with the form for that.

Can someone walk me through, step by step how to do that, please?

Thanks again.

try67
Community Expert
Community Expert
October 13, 2016

You need to carefully think about it... If the data is in a file that's attached to the PDF then someone could simply open that file and have access to everyone's information, which is probably not what you want. If you want the data to be private then you need to look for a different solution, possibly not in the form of a PDF file.

try67
Community Expert
Community Expert
October 13, 2016

Yes, this would require the development of a custom-made script. I've created something very similar that works with a drop-down instead of a text field, but adjusting it to work with the latter should not be too difficult. You can find it here: Custom-made Adobe Scripts: Acrobat -- Populate Fields From Dropdown

Basically, the process to follow is to take the value entered in the field, iterate over the data source, looking for a match in the right column, and then when a match if found use the rest of the values from that row to populate the other fields.