Smartsheet API - document generation and attachment to row.
Been struggling a bit with recent smartsheet api development and was hoping for some insight as to how to handle the following situation:
To bypass the restriction of 5000 rows per sheet, I'm developing an app using NodeJS sdk that will run on a scheduler in the following fashion:
If row count is 4500, next time this app runs it will take a set of rows and "archive" them by creating an excel file or PDF and attaching those rows to another archive sheet.
I've gotten to the point where i have an array of row objects, and know exactly what I'm looking to turn into a document. After doing alot of research, apparently you cant generate any sort of documents from smartsheet api outside of full sheets, or reports which you arent allowed to manipulate programatically?
Am I really expected to create a new sheet, copy these rows over, generate a document, delete sheet, then push this to a smartsheet row? Is there some sort of API features that I'm overlooking?
thanks!
Comments
-
Hi—
Since you're getting the rows that you need, you might consider stringifying them and pushing them to a file. Here's a stack overflow community post on how to do that: https://stackoverflow.com/questions/36856232/write-add-data-in-json-file-using-node-js
You'll want to investigate further on how to save as PDF.
There are also some node modules out there that third parties have created which will convert json to csv. Disclaimer on this, I haven't used this one so test this out at your own risk: https://stackoverflow.com/questions/36856232/write-add-data-in-json-file-using-node-js
You could pass your JSON through a module like that and have it save as .csv, then post it as an attachment to a row: https://smartsheet-platform.github.io/api-docs/#simple-uploads
I think .csv is a better option for you because the data will be more editable and easier to work with.
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.2K Get Help
- 419 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 142 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives