批量更新父ID (Python API)
我正在建立一个项目进度表,它代表了整个制造生产计划。ob欧宝娱乐app手机下载生成的智能表大约有7000行。我已经找到了一种方法,除了设置父id之外,还可以使用批量API调用,这现在需要20分钟以上的时间。
以下是基本流程:
在内存中创建生产计划ob欧宝娱乐app手机下载
—导出为CSV
—将CSV导入到新工作表(工作表a)
—将模板甘特工作表复制到新工作表(工作表B)
—将所有导入的行从工作表A复制到工作表B(甘特图),因为将CSV导入到甘特图不起作用。也许可以把这两个步骤浓缩一下。但是,这不是我的问题。
——我的问题是。现在我必须为每个父ID运行一次重复的update_rows()请求。这是必要的,因为update_rows()不允许在同一个调用中更新不同的父id。按父母ID分组让我大大减少了通话次数,但我仍然达到了速率限制。
是否有一种方法a)在CSV导入中包含父ID,或者b)以某种方式导入批量更新到父ID ?
答案
-
吉纳维芙P。 员工管理
如果我对您的理解正确,您希望通过API更新行来创建层次结构。在本例中,您是正确的—您需要对每个Parent行执行一次调用。
以下是StackOverflow中的一个讨论,可能会有所帮助:使用Python SDK以编程方式构建整个表单
欢呼,
吉纳维芙
类别
See below link:<\/p>
https:\/\/smartsheet.redoc.ly\/tag\/groups#operation\/add-group<\/a><\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":320,"name":"API & Developers","url":"https:\/\/community.smartsheet.com\/categories\/api-developers","allowedDiscussionTypes":[]},"reactions":[{"tagID":3,"urlcode":"Promote","name":"Promote","class":"Positive","hasReacted":false,"reactionValue":5,"count":0},{"tagID":5,"urlcode":"Insightful","name":"Insightful","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":11,"urlcode":"Up","name":"Vote Up","class":"Positive","hasReacted":false,"reactionValue":1,"count":0},{"tagID":13,"urlcode":"Awesome","name":"Awesome","class":"Positive","hasReacted":false,"reactionValue":1,"count":0}],"tags":[{"tagID":227,"urlcode":"api-and-developers","name":"API and Developers"},{"tagID":442,"urlcode":"groups-and-group-management","name":"Groups and Group Management"}]},{"discussionID":106741,"type":"question","name":"Using the API to get attachment URLs","excerpt":"I have PDF row attachments in a sheet. I need to get a direct URL to the attachment but I can't see a way to do this in the API. Using the GUI to \"send\" the file provides a link - so I'm trying to get something similar through the API. I'm aware that the the URL using the GUI method expires after 30 days. I would prefer…","categoryID":320,"dateInserted":"2023-06-21T22:40:34+00:00","dateUpdated":null,"dateLastComment":"2023-06-22T20:21:40+00:00","insertUserID":150432,"insertUser":{"userID":150432,"name":"jzadra","url":"https:\/\/community.smartsheet.com\/profile\/jzadra","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-23T19:55:05+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":150432,"lastUser":{"userID":150432,"name":"jzadra","url":"https:\/\/community.smartsheet.com\/profile\/jzadra","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-23T19:55:05+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":28,"score":null,"hot":3374853734,"url":"https:\/\/community.smartsheet.com\/discussion\/106741\/using-the-api-to-get-attachment-urls","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/106741\/using-the-api-to-get-attachment-urls","format":"Rich","tagIDs":[227,268],"lastPost":{"discussionID":106741,"commentID":381846,"name":"Re: Using the API to get attachment URLs","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/381846#Comment_381846","dateInserted":"2023-06-22T20:21:40+00:00","insertUserID":150432,"insertUser":{"userID":150432,"name":"jzadra","url":"https:\/\/community.smartsheet.com\/profile\/jzadra","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-06-23T19:55:05+00:00","banned":0,"punished":0,"private":false,"label":"✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"API & Developers","url":"https:\/\/community.smartsheet.com\/categories\/api-developers"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-06-22T20:20:13+00:00","dateAnswered":"2023-06-22T00:36:56+00:00","acceptedAnswers":[{"commentID":381653,"body":" You make a call to<\/p> https:\/\/api.smartsheet.com\/2.0\/sheets\/$Sheet_ID?include=attachments<\/a><\/p> substituting $Sheet_ID for the sheet ID and get the attachment id for each row<\/p> Then call<\/p>