从 Google 表格中的 Pipedrive API 导入数据 - 自定义字段?
Importing data from Pipedrive API in Google Sheets - custom fields?
一段时间以来,我一直在阅读周围的点点滴滴,试图进入 API 的东西(不可否认,几乎所有的东西都超出了我的范围),发现 post which I was able to link our Pipedrive 进入 Google 工作表,但是当我尝试使用以数字开头的自定义字段 API 键时,它似乎绊倒了?
即似乎偶然发现了 data.132 的推送...(从底部开始的第 7 行)
任何 clues/pointers 将不胜感激!
// Standard functions to call the spreadsheet sheet and activesheet
function GetPipedriveDeals() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var sheet = ss.getActiveSheet();
//the way the url is build next step is to iterate between the end because api only allows a fixed number of calls (100) this way i can slowly fill the sheet.
var url = "https://api.pipedrive.com/v1/deals:(org_name,title,owner_name,status,pipeline_id,value,a4f55810dfde1c6bead0709c5e0362a693e1a737,132c9a542e33bb3a2af984585eab85a0ee95b708)?start=";
var limit = "&limit=500";
var filter = "&filter_id=64";
var pipeline = 1; // put a pipeline id specific to your PipeDrive setup
var start = 0;
// var end = start+50;
var token = "&api_token=YOUR_API_TOKEN"
//call the api and fill dataAll with the jsonparse.
//then the information is set into the
//dataSet so that i can refill datall with new data.
var response = UrlFetchApp.fetch(url+start+limit+filter+token);
var dataAll = JSON.parse(response.getContentText());
var dataSet = dataAll;
//create array where the data should be put
var rows = [], data;
for (var i = 0; i < dataSet.data.length; i++) {
data = dataSet.data[i];
if(data.pipeline_id === pipeline){
rows.push([data.title, data.org_name, data.owner_name, data.status, data.pipeline_id, data.a4f55810dfde1c6bead0709c5e0362a693e1a737, data.value, data.132c9a542e33bb3a2af984585eab85a0ee95b708]);//your JSON entities here
}
}
Logger.log( JSON.stringify(rows,null,2) ); // Log transformed data
return rows;
}
这里是管道驱动工程师。我认为您有 javascript 对象 属性 引用问题 - 它不能以数字开头。尝试:
rows.push([data.title, data.org_name, data.owner_name, data.status, data.pipeline_id, data['a4f55810dfde1c6bead0709c5e0362a693e1a737'], data.value, data['132c9a542e33bb3a2af984585eab85a0ee95b708']]);//your JSON entities here
一段时间以来,我一直在阅读周围的点点滴滴,试图进入 API 的东西(不可否认,几乎所有的东西都超出了我的范围),发现
即似乎偶然发现了 data.132 的推送...(从底部开始的第 7 行)
任何 clues/pointers 将不胜感激!
// Standard functions to call the spreadsheet sheet and activesheet
function GetPipedriveDeals() {
var ss = SpreadsheetApp.getActiveSpreadsheet();
var sheets = ss.getSheets();
var sheet = ss.getActiveSheet();
//the way the url is build next step is to iterate between the end because api only allows a fixed number of calls (100) this way i can slowly fill the sheet.
var url = "https://api.pipedrive.com/v1/deals:(org_name,title,owner_name,status,pipeline_id,value,a4f55810dfde1c6bead0709c5e0362a693e1a737,132c9a542e33bb3a2af984585eab85a0ee95b708)?start=";
var limit = "&limit=500";
var filter = "&filter_id=64";
var pipeline = 1; // put a pipeline id specific to your PipeDrive setup
var start = 0;
// var end = start+50;
var token = "&api_token=YOUR_API_TOKEN"
//call the api and fill dataAll with the jsonparse.
//then the information is set into the
//dataSet so that i can refill datall with new data.
var response = UrlFetchApp.fetch(url+start+limit+filter+token);
var dataAll = JSON.parse(response.getContentText());
var dataSet = dataAll;
//create array where the data should be put
var rows = [], data;
for (var i = 0; i < dataSet.data.length; i++) {
data = dataSet.data[i];
if(data.pipeline_id === pipeline){
rows.push([data.title, data.org_name, data.owner_name, data.status, data.pipeline_id, data.a4f55810dfde1c6bead0709c5e0362a693e1a737, data.value, data.132c9a542e33bb3a2af984585eab85a0ee95b708]);//your JSON entities here
}
}
Logger.log( JSON.stringify(rows,null,2) ); // Log transformed data
return rows;
}
这里是管道驱动工程师。我认为您有 javascript 对象 属性 引用问题 - 它不能以数字开头。尝试:
rows.push([data.title, data.org_name, data.owner_name, data.status, data.pipeline_id, data['a4f55810dfde1c6bead0709c5e0362a693e1a737'], data.value, data['132c9a542e33bb3a2af984585eab85a0ee95b708']]);//your JSON entities here