Copy link to clipboard
Copied
Hello,
I have reviewed the following thread: Create a dynamic dropdown field in Adobe Acrobat Pro XI and it does basically what I want, but I need some help with making the choices easier to update.
For sake of being quick, I would like to use the original questions properties so that anyone who follows this can be helped and I have attached the scripting I am referencing in the picture below. Is it possible that instead of putting set responses (ie Hospice, Hospital, Nursing Facility, etc) I could have it generate these off a separated list? In my case, these options change frequently and there is a lot of them, so I would like to be able to maintain an excel sheet and either link them or copy and past these options somehow. I am very new to JavaScripting, but am willing to learn and read up if someone had a good resource for this.
Thank you for any help,
KaleighP
Copy link to clipboard
Copied
Yes, there are a few different techniques for automatically updating lists.
First, the list data has to stored in a way that can be updated, and accessed.
Read this article on setting a list with a list:
https://acrobatusers.com/tutorials/js_list_combo_livecycle
The idea is to create a JS object that contains all the data needed for dynamically setting the list, as opposed to the technique you are using, which hard codes the data into the script. The JS object is defined in a document script where it can be changed without affecting the rest of the document.
You'll also find a great deal on lists programming here:
https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm
Next, you'll need a tool for loading the list data from external source.
You can download a tool here that shows a simple method for loading list data:
Free Sample PDF Files with scripts
And you'll find more general info here on loading directly from a CSV file:
https://www.pdfscripting.com/public/ExcelAndAcrobat.cfm
However, whatever method you do use, will need lots of customization. The script will need to translate the data gathered from the CSV file into the object notation used in the first article link above, and overwrite the document level script where the data is defined.
Use the Acrobat JavaScript Reference early and often
Copy link to clipboard
Copied
Yes, there are a few different techniques for automatically updating lists.
First, the list data has to stored in a way that can be updated, and accessed.
Read this article on setting a list with a list:
https://acrobatusers.com/tutorials/js_list_combo_livecycle
The idea is to create a JS object that contains all the data needed for dynamically setting the list, as opposed to the technique you are using, which hard codes the data into the script. The JS object is defined in a document script where it can be changed without affecting the rest of the document.
You'll also find a great deal on lists programming here:
https://www.pdfscripting.com/public/List-Field-Usage-and-Handling.cfm
Next, you'll need a tool for loading the list data from external source.
You can download a tool here that shows a simple method for loading list data:
Free Sample PDF Files with scripts
And you'll find more general info here on loading directly from a CSV file:
https://www.pdfscripting.com/public/ExcelAndAcrobat.cfm
However, whatever method you do use, will need lots of customization. The script will need to translate the data gathered from the CSV file into the object notation used in the first article link above, and overwrite the document level script where the data is defined.
Use the Acrobat JavaScript Reference early and often

