2017-02-09 2 views
0

にCSVをプッシュはGoogle AppスクリプトQualtricsのAPIに:</p> <p>1)ZIPファイルを返しQualtricsにAPIリクエストをオフに解雇:ダウンロード、解凍、私は自動的に一日一回にはGoogle Appsスクリプトを使用したいシート

2)は、ZIPファイル

3)

が、私は、コードの相対的な初心者だGoogleスプレッドシートに新たなCSVファイルを読み込み、それをすべてはそれを動作させるためにその概念を理解することができる統合とアンパック基本的な構文、およびスクリプトの編集について説明します。ご協力いただき誠にありがとうございます!いくつかのより多くのノート:

STEP 1) Qualtrics APIは

に必要とは、まずダウンロードして返されたファイルID(例えば "ES_e7s2ja08o9o4df6cd7ptckmfma")を取るCreate Response Export

var settings = { 
    "async": true, 
    "crossDomain": true, 
    "url": "https://uwa.qualtrics.com/API/v3/responseexports", 
    "method": "POST", 
    "headers": { 
    "x-api-token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 
    "surveyid": "SV_1F9ldubC3O1BcUJ", 
    "content-": "application/json", 
    "content-type": "application/json" 
    }, 
    "processData": false, 
    "data": "{\r\n \"format\": \"csv\",\r\n \"surveyId\": \"SV_1F9ldubC3O1BcUJ\",\r\n \"includedQuestionIds\": [],\r\n \"useLabels\": true\r\n}" 
} 

$.ajax(settings).done(function (response) { 
    console.log(response); 
}); 

を経由してファイルを作成しますGet Response Export File

var settings = { 
    "async": true, 
    "crossDomain": true, 
    "url": "https://uwa.qualtrics.com/API/v3/responseexports/ES_e7s2ja08o9o4df6cd7ptckmfma/file", 
    "method": "GET", 
    "headers": { 
    "x-api-token": "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx", 
    "content-type": "application/json" 
    } 
} 

$.ajax(settings).done(function (response) { 
    console.log(response); 
}); 

STEPを経由してファイル2) [unzip(blob)] [3]を介してダウンロードしたファイルを解凍しますか?

STEP 3)おそらく申し出二つのオプション:

(a)のようにどこかに保存するCSVを必要=するimportData( "URL")を介して自身にデータをダウンロードするには、Googleのシートを指示する私Googleドライブ

(b)はその[GoogleスプレッドシートのAPI]を経由してGoogleスプレッドシートにそれをプッシュする[4]

答えて

関連する問題