第七色在线视频,2021少妇久久久久久久久久,亚洲欧洲精品成人久久av18,亚洲国产精品特色大片观看完整版,孙宇晨将参加特朗普的晚宴

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

如何從谷歌表中獲取數(shù)據(jù)作為字典數(shù)組

如何從谷歌表中獲取數(shù)據(jù)作為字典數(shù)組

白衣非少年 2021-08-26 17:47:39
我很難將行和列中包含的數(shù)據(jù)格式化為字典數(shù)組。以下是我試圖實現(xiàn)的格式:[[id: "abchdha", name: "Orange", health: "fruit", price: 50], [id: "123fsf", name: "Apple", health: "fruit", price: 50]]這是我的谷歌表格腳本:var secret = "mysecretcode"function getFirebaseUrl(jsonPath) {  /*  We then make a URL builder  This takes in a path, and  returns a URL that updates the data in that path  */  return (    'myfirebaselink' +    jsonPath +    '.json?auth=' +    secret  )}function syncMasterSheet(excelData) {  /*  We make a PUT (update) request,  and send a JSON payload  More info on the REST API here : https://firebase.google.com/docs/database/rest/start  */  var options = {    method: 'put',    contentType: 'application/json',    payload: JSON.stringify(excelData)  }  var fireBaseUrl = getFirebaseUrl('masterSheet')  /*  We use the UrlFetchApp google scripts module  More info on this here : https://developers.google.com/apps-script/reference/url-fetch/url-fetch-app  */  UrlFetchApp.fetch(fireBaseUrl, options)}function startSync() {  //Get the currently active sheet  var sheet = SpreadsheetApp.getActiveSheet()  //Get the number of rows and columns which contain some content  var [rows, columns] = [sheet.getLastRow(), sheet.getLastColumn()]  //Get the data contained in those rows and columns as a 2 dimensional array  var data = sheet.getRange(1, 1, rows, columns).getValues()  syncMasterSheet(data)}我需要將函數(shù)startSync()設(shè)置為var data等于我想要的格式。:)
查看完整描述

1 回答

  • 1 回答
  • 0 關(guān)注
  • 191 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯(lián)系客服咨詢優(yōu)惠詳情

幫助反饋 APP下載

慕課網(wǎng)APP
您的移動學(xué)習(xí)伙伴

公眾號

掃描二維碼
關(guān)注慕課網(wǎng)微信公眾號