Can you use exportData() in a snippet and export data from a table without the column headers?

  • 1
  • Question
  • Updated 2 years ago
  • Answered
I'm looking to provide end users with the ability to export data from a table to a .csv file without column headings (field name/labels). Is this possible with the current exportData() method?

Thanks - Jeff Rutter
Photo of Jeff Rutter

Jeff Rutter

  • 1,212 Points 1k badge 2x thumb

Posted 2 years ago

  • 1
Photo of Bill McCullough

Bill McCullough, Champion

  • 13,310 Points 10k badge 2x thumb

Jack Sanford posted an export snippet here->

I modified his script and 'left out' the field labels.  Here is a sample page based on Tasks.
<skuidpage unsavedchangeswarning="yes" personalizationmode="server" useviewportmeta="true" showsidebar="true" showheader="true" tabtooverride="Task">
        <model id="Task" limit="100" query="true" createrowifnonefound="false" datasourcetype="salesforce" datasource="salesforce" sobject="Task">
                <field id="Subject"/>
                <field id="CreatedDate"/>
        <pagetitle model="Task" uniqueid="sk-3KScRx-83">
                <action type="multi" label="Export Tasks" uniqueid="sk-3KSfkM-126">
                        <action type="custom" snippet="exportSnippet"/>
                <action type="savecancel" uniqueid="sk-3KScRv-82"/>
            <jsitem location="inlinesnippet" name="exportSnippet" cachelocation="false">var $ = skuid.$;
                var today = new Date();
                var model = skuid.model.getModel('Task');
                var fields = [
                //use the api names of your fields here
                var fieldsWithCorrectLabels = $.map(fields, function(v){
                    var actualField = model.getField(v);
                     return {
                    fileName: 'Custom Export File Name '+today+'.csv',
                    fields: fieldsWithCorrectLabels,
                    doNotAppendRowIdColumn: true
            <styleitem type="background" bgtype="none"/>