0

Ich habe ein Dashboard ähnlich dem Beispiel in Google Apps Script Help Center erstellt. Es enthält Steuerelemente, die das Arbeitsblatt filtern, das die Daten enthält. Ich möchte eine Option im Dashboard hinzufügen, die es den Benutzern ermöglicht, die gefilterte Ansicht in eine neue CSV-Datei oder eine Google Sheets-Datei zu exportieren, die in der Google Drive-Datei gespeichert werden. Ich habe jedoch keine Ahnung, wie das geht. Irgendwelche Vorschläge?Google Apps Script: Dashboard in CSV exportieren

Antwort

0

Hier ist ein Code-Snippet von Google Tutorial:

function saveAsCSV() { 
    // Prompts the user for the file name 
    var fileName = Browser.inputBox("Save CSV file as (e.g. myCSVFile):"); 

    // Check that the file name entered wasn't empty 
    if (fileName.length !== 0) { 
    // Add the ".csv" extension to the file name 
    fileName = fileName + ".csv"; 
    // Convert the range data to CSV format 
    var csvFile = convertRangeToCsvFile_(fileName); 
    // Create a file in the Docs List with the given name and the CSV data 
    DocsList.createFile(fileName, csvFile); 
    } 
    else { 
    Browser.msgBox("Error: Please enter a CSV file name."); 
    } 
}* 

Ansicht der full tutorial and code here.

Verwandte Themen