Use VBA to get a dropdown list value

New Here ,
Mar 20, 2020 Mar 20, 2020

Copy link to clipboard

Copied

Hello All,

I am using the JSO object and get field method to retrieve the values of dropdown lists from a form and place them into a variable which is then placed in a spreadsheet. In the following code the mobjJSO has already been initialized.  The value of the array is the name of the dropdown list  that is Skill_1.  I have confirmed the name and that it is on the PDF form.  I have other dropdowns that this appears to work correctly to bring back the value, but for this one I actually get the number of item that was chosen in the listing instead of the text.  For instance, if the user chose Data Entry below returns a 2 for the second item in the list instead of "Data Entry".  Does anybody know what I am doing wrong?  I just can't seem to get this to work.  

strValue = mobjJSO.getField(mobjLookupArray(i, 0)).Value  

Thank you!

Thayana

TOPICS
Acrobat SDK and JavaScript, How to, PDF forms

Views

59

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct Answer

Adobe Community Professional , Mar 23, 2020 Mar 23, 2020
Did you check the export values in the list?  This is what is returned as the value of the list field. 

Likes

translate

Translate

Translate
Adobe Community Professional ,
Mar 23, 2020 Mar 23, 2020

Copy link to clipboard

Copied

Did you check the export values in the list?  This is what is returned as the value of the list field. 

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

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 25, 2020 Mar 25, 2020

Copy link to clipboard

Copied

Thanks! That was it.

Likes

translate

Translate

Translate

Report

Report
Community Guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines