gpt4 book ai didi

javascript - Google 电子表格 - 从 Zoho 获取记录

转载 作者:行者123 更新时间:2023-11-27 23:17:52 24 4
gpt4 key购买 nike

从 Google Spreadshhet,我正在尝试从 Zoho 收集记录。

我已经测试了这段代码:

var urlgetRecords = 'https://crm.zoho.com/crm/private/json/Leads/getRecords?newFormat=1&authtoken=00000&scope=crmapi&selectColumns=Leads(First Name,Last Name,Email)&fromIndex=1&toIndex=2&sortColumnString=First Name&sortOrderString=desc';

var jsonResponse = UrlFetchApp.fetch(urlgetgetRecords);

这就是获得的结果:

{"response":{"result":{"Leads":{"row":[{"no":"1","FL":[{"content":"1412559000000441145","val":"LEADID"},{"content":"Víctor","val":"First Name"},{"content":"Aguilera Moreno","val":"Last Name"},{"content":"v-aguilera@hotmail.com","val":"Email"}]},{"no":"2","FL":[{"content":"1412559000000308001","val":"LEADID"},{"content":"Victor","val":"First Name"},{"content":"Porta","val":"Last Name"},{"content":"vporta@test.es","val":"Email"}]}]}},"uri":"/crm/private/json/Leads/getRecords"}}

请问,如何在电子表格中写入该响应中的每一行?

提前非常感谢您:)

最佳答案

Sandy Good 的代码非常完美。我不得不再添加两行。

最后有效的代码是:

var urlgetRecords = 'https://crm.zoho.com/crm/private/json/Leads/getRecords?newFormat=1&authtoken=' + authToken + '&scope=crmapi&selectColumns=Leads(First Name,Last Name,Email)&fromIndex=1&toIndex=2&sortColumnString=First Name&sortOrderString=desc';
var jsonResponse = UrlFetchApp.fetch(urlgetRecords);
var jsonText = jsonResponse.getContentText();
var objetoFinal = JSON.parse(jsonText);
writeZohoToSheet(objetoFinal);

非常感谢您的帮助@SandyGood

关于javascript - Google 电子表格 - 从 Zoho 获取记录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35660296/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com