Skip to main content
Participant
March 20, 2019
Question

java script for button to load CSV into fields

  • March 20, 2019
  • 1 reply
  • 1689 views

Hi,
I don't know java script, but some where along my path someone gave me the simple java script for my button to load  previously saved PDF data back into a PDF.
Could someone let me know if there is also a simple script to load CSV data into a PDF and what it is?

thanks for all your help

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
March 20, 2019

Try this command:

this.importTextData();

20GTXAuthor
Participant
March 21, 2019

I saved the CSV file from Excel using the format you mentioned in this Post and made the button but nothing happened.

Then I tried to import it into the PDF via Tools - Forms - More Form Options - Import Data and got the error "could not load data from text file

PDF

CSV

try67
Community Expert
Community Expert
March 21, 2019

The format of the file needs to be two rows, with the field names in the first and the values in the second.

You seem to have multiple rows, which is OK, but you'll only be able to import one of them.

Also, I would remove the first column since it doesn't have a field name in it.

And you need to make sure that the names of the fields in the CSV file match those in the PDF exactly, including lower/upper-case letters.