Skip to main content
Participant
Mar 20, 2019 12:22 PM UTC
Question

java script for button to load CSV into fields

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 is closed to new replies. Start a new post to keep the conversation going.

3 replies

try67
Community Expert
Community Expert
Mar 20, 2019 1:01 PM UTC

Try this command:

this.importTextData();

Translate
20GTXAuthor
Participant
Mar 21, 2019 9:34 PM UTC

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

Translate
try67
Community Expert
Community Expert
Mar 21, 2019 9:55 PM UTC

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.

Translate