Skip to main content
Participant
September 20, 2016
Answered

Export Specific Fields

  • September 20, 2016
  • 1 reply
  • 452 views

I'm using the Merge Data Files Into Spreadsheet tool to create a CSV File, and it works great for what I need, but I was wondering if there was a way to choose with fields to export. I need all the information for the PDF but not all of it is necessary for a condensed file I also need to create.

This topic has been closed for replies.
Correct answer George_Johnson

It is, but there's not a built-in feature for this, so you'd have to use a custom JavaScript. I'd recommend tab-delimited over CSV as they are significantly easier to generate correctly. Here's a simple script that writes tab-delimited data to the JavaScript console (Ctrl+J), which you can then copy & paste into a file.

// List of fields to export

var aF = ["text1", "text2", "checkbox4", "dropdown6"];

// Loop through array of fields and add field values to array

var aValues = [];

for (var i = 0; i < aF.length; i += 1) {

    aValues.push(getField(aF).valueAsString);

}

// Write tab-delimited data to console

console.println(aValues.join("\t"));

1 reply

George_JohnsonCorrect answer
Inspiring
September 20, 2016

It is, but there's not a built-in feature for this, so you'd have to use a custom JavaScript. I'd recommend tab-delimited over CSV as they are significantly easier to generate correctly. Here's a simple script that writes tab-delimited data to the JavaScript console (Ctrl+J), which you can then copy & paste into a file.

// List of fields to export

var aF = ["text1", "text2", "checkbox4", "dropdown6"];

// Loop through array of fields and add field values to array

var aValues = [];

for (var i = 0; i < aF.length; i += 1) {

    aValues.push(getField(aF).valueAsString);

}

// Write tab-delimited data to console

console.println(aValues.join("\t"));