Issue When importing an EXCEL file with API ? (switched indent !!)

Hi all,
I have a question about what seems to be an issue in smartsheet API.
I am surprised not to have found this bug in the forums because the Excel import in smartsheet must be very used?
Here is the issue :
When you import an Excel file containing indentation, with this script :
https://smartsheet.redoc.ly/tag/import/
curl https://api.smartsheet.com/2.0/folders/{folderId}/sheets/import?sheetName=MarketingProgressReport&headerRowIndex=0&primaryColumnIndex=0 \ -H "Authorization: Bearer JKlMNOpQ12RStUVwxYZAbcde3F5g6hijklM789" \ -H "Content-Disposition: attachment" \ -H "Content-Type: text/csv" \ -X POST \ --data-binary @ProgressReport.csv
Then, all the indentation are switched,ONLY when you use the headerRowIndex=0Option, to set the column title with the first Row, see below.
Any idea ? did i miss something ?
Thx for your help
Best Answer
-
jmyzk_cloudsmart_jp ✭✭✭✭✭
Hi@Fabrice
I have also identified such a problem when importing a grouped Excel sheet into Smartsheet using the API and specifying a Header Row.
Here is the Python function code to fix this problem
- First, import with header_row_index=None.
- Next, update the Columns of the sheet with the values of the header_row cells.
- 最后,delete the unnecessary rows.
Answers
-
jmyzk_cloudsmart_jp ✭✭✭✭✭
Hi@Fabrice
I have also identified such a problem when importing a grouped Excel sheet into Smartsheet using the API and specifying a Header Row.
Here is the Python function code to fix this problem
- First, import with header_row_index=None.
- Next, update the Columns of the sheet with the values of the header_row cells.
- 最后,delete the unnecessary rows.
-
Fabrice ✭✭✭
Hi @Junichiro
Thx for this answer and the link with the fix code️
I developped also my side such a python function: It is functionnal, but it slows down a lot the import when you have a lot of column. (each column update takes about 1 sec)
I Also opened a ticket with smartsheet Support for this issue, i hope smartsheet will fix the issue !
kind regards
Fabrice
Categories
Hey @Carlo Rodriguez<\/a> <\/p>
This is how I've successfully added a cell-link using the API:<\/p>
PUT (with the destination sheet data): <\/p>
https:\/\/api.smartsheet.com\/2.0\/sheets\/XXXX\/rows\/X<\/a>XXX<\/p>
{\n \"cells\": [\n {\n \"columnId\": 11111,\n \"value\": null,\n \"linkInFromCell\": {\n \"sheetId\": 22222,\n \"rowId\": 33333,\n \"columnId\": 44444\n }\n }\n ]\n}\n<\/pre>
<\/p>Let me know if this works for you!<\/p>
Cheers,<\/p>
Genevieve<\/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":472,"urlcode":"cell-linking","name":"Cell linking"},{"tagID":563,"urlcode":"api","name":"API"}]},{"discussionID":107490,"type":"question","name":"How could we know who add\/create new column?","excerpt":"hello all, My smart sheet just showed 3 new columns, I checked with my teammates and none of them add those columns so is there any record we can track for add\/create column? In addition, new columns content is quite similar with one of the column, not 100% match , but partial of it, column name is more or less the same as…","snippet":"hello all, My smart sheet just showed 3 new columns, I checked with my teammates and none of them add those columns so is there any record we can track for add\/create column? In…","categoryID":320,"dateInserted":"2023-07-12T10:35:43+00:00","dateUpdated":null,"dateLastComment":"2023-07-12T12:04:42+00:00","insertUserID":163370,"insertUser":{"userID":163370,"name":"Uyen Nguyen","url":"https:\/\/community.smartsheet.com\/profile\/Uyen%20Nguyen","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-07-12T11:51:51+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":null,"lastUserID":8888,"lastUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-07-21T23:51:40+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":7,"countViews":51,"score":null,"hot":3378325825,"url":"https:\/\/community.smartsheet.com\/discussion\/107490\/how-could-we-know-who-add-create-new-column","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/107490\/how-could-we-know-who-add-create-new-column","format":"Rich","lastPost":{"discussionID":107490,"commentID":384775,"name":"Re: How could we know who add\/create new column?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/384775#Comment_384775","dateInserted":"2023-07-12T12:04:42+00:00","insertUserID":8888,"insertUser":{"userID":8888,"name":"Andrée Starå","title":"Smartsheet Expert Consultant & Partner | Workflow Consultant \/ CEO @ WORK BOLD","url":"https:\/\/community.smartsheet.com\/profile\/Andr%C3%A9e%20Star%C3%A5","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/userpics\/0PAU3GBYQLBT\/nXWM7QXGD6464.jpg","dateLastActive":"2023-07-21T23:51:40+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭✭✭"}},"breadcrumbs":[{"name":"Home","url":"https:\/\/community.smartsheet.com\/"},{"name":"Get Help","url":"https:\/\/community.smartsheet.com\/categories\/get-help"},{"name":"API & Developers","url":"https:\/\/community.smartsheet.com\/categories\/api-developers"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-07-12T11:51:49+00:00","dateAnswered":"2023-07-12T10:48:03+00:00","acceptedAnswers":[{"commentID":384764,"body":"
If the column names are similar<\/em> but not exactly the same as the ones on the sheet, it is possible that some rows have been moved from another sheet with a similar purpose. <\/p>
You should be able to see this in the Activity Log (if you have access), but the other giveaway will be that will data in the similarly named columns but not the original ones.<\/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":[]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=320&includeChildCategories=1&type%5B0%5D=Question&excludeHiddenCategories=1&sort=-hot&limit=3&expand%5B0%5D=all&expand%5B1%5D=-body&expand%5B2%5D=insertUser&expand%5B3%5D=lastUser&status=accepted","prevURL":null,"currentPage":1,"total":206,"limit":3},"title":"Trending in API & Developers","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">