Automatically creating new columns when import data from API
When using API to fetch data from other platforms and import into SmartSheet, how to automatically create new columns, if there are more columns in the data than the target sheet on SmartSheet (right now, importing data from API to SmartSheet need to specify column ID, but when we have a dataset with many columns, this become a problem if we hardcode every column ID) ? Thank you!
Answers
-
I'm assuming that you are matching columns from the source and data by column headings/names?
You need to first read the target sheet and build a table of column names to IDs. Then read the source sheet and if there are any column headings/names not already in the sheet you need to create them and add them to the table.
Then you can load the data from the source sheet.
/marc
-
Hi, thanks for your reply. Yes I am trying to match by column heading/names. I tried to use your approach of mapping the columns based on IDs and it works. The following picture shows how I did this. Thanks!
Meanwhile, I am also trying to know if there are "more automated" approach, for instance, without having to specifying column ID matching between the target and source sheet through hard coding like this. Many thanks!
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 64.1K Get Help
- 414 Global Discussions
- 221 Industry Talk
- 461 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 141 Just for fun
- 58 Community Job Board
- 462 Show & Tell
- 32 Member Spotlight
- 1 SmartStories
- 299 Events
- 38 Webinars
- 7.3K Forum Archives