Bug: CSV import results in wrong column type

J. Craig Williams
J. Craig Williams ✭✭✭✭✭✭
edited 12/09/19 inSmartsheet Basics

When I import a csv file with a numeric column but more than half of the data is 0 or 1's, the column becomes a CheckBox column.

Less than half and it is (accurately) a Text/Number column.

Either the threshold should be much lower, or any non-Boolean number should force the column type to be Text/Number, or the user should be able to select the column type during import

I have submitted to support with three csv files.

Craig Williams

the_csv_file.png

the_results.png

Comments

  • Hi Craig—

    Not necessarily sure if this is a bug or not. It could be automatic logic that we perform on purpose to try and guess at the column types that you need without causing data corruption or misinterpretation on import.

    Question: what are the drawbacks to changing the column type after import vs having an option to select the column type during import?

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    Changing column type from CheckBox to Text/Number results in

    true, false

    Not 1,0

    If there are 49% numbers that are > 1 and 51% that are 0,1 that's pretty clear to me. 50% is arbitrary.

    Craig

  • I am having the same problem.

    Is there a fix or workaround for this issue?

  • J. Craig Williams
    J. Craig Williams ✭✭✭✭✭✭

    Work-around #1:

    In my specific case, I opened the csv file in an editor and replaced

    ,1^p

    with

    ,ONE^p

    and then imported. I then searched and replaced ONE with 1

    (you need an editor the understands regex - my offending column happened to be in the last column)

    方法# 2:

    If it hadn't been, I would have written a quick awk script (a one liner) to replace 1's in the offending column.

    As in most things of this nature, it depends on the data.

    Craig

  • My workaround:

    Import .csv as is

    Change column type from checkbox to text/number

    Highlight the column

    Ctrl+ F to replace "false" with "0", "", or null (your preference)

    Repeat to replace "true" with "1"

  • I am having a similar problem except that I want for the column to input as text rather than a number. when I use Vlookup and the cell is a number (ie. 40144821), the Vlookup doesn't work. It does work if it reads as text however (ie. 40144821-01). The only work around I have found is to mannually re-enter the numbers. However, this applies to more than 50% of my cell values so is not a great option. I have tried importin csv and xcel files to the same end. I have also tried making the column a number field in the spreadsheet before importing. also does not work.

    Any suggestions?

  • AaronO
    AaronO ✭✭✭

    Wow, a five-year-old thread on this topic. This is terrible behavior. Maybe it's not a "bug" but the logic used to interpret column types is inscrutable.

    Consider this csv file:

    t1,t2,t3,t4 1,1,0,0.0 1,0,0,0.0 0,0,0,0.0 0,"hi",0,0.0

    Importing this results in:

    image.png

    Column t1 is a text/number column

    Column t2 is a checkbox column except it has some text in it

    Column t3 is a checkbox column

    Column t4 is a DROPDOWN column with only one option: 0

    There is not a world in which this is a useful interpretation. Column t1 is numbers but column t3 is checkboxes? Column t2 is checkboxes+other but Column t4 is a dropdown? Column t3 and t4 are both effectively all zeros but have different types?

    几乎所有我进口数量但can't add them together? If I add another column and put in a formula on the first row, this works: "=SUM([t1]@row:[t4]@row)" but this gives an error: "=[t3]@row + [t4]@row". (That's especially weird - SUM and + work differently?)

    And this is what bit me: if I import two sheets, one of which has all "0" in a certain column and the other has other values in that column, they can't be brought into a report together - the two columns are interpreted as being of different types and so can't be combined in the report. Forcing me to go in and fiddle with column types when all I interpreted was a lot of numbers is extremely confusing.

    It seems like it would be much better to just interpret everything as text/number - if I want to get fancy and turn things into other types, I can do that later. Or I could select the column type in the import dialog, with text/number as the default - that seems like a much better fit than (what seem like) arbitrary interpretations. If I'm importing data, it's almost certainly from a program that doesn't know about checkboxes, making a checkbox column is more likely to hurt than help!

    Aaron

  • AaronO
    AaronO ✭✭✭

    I should also note Shaine's question above: what are the drawbacks to changing the column type after import vs having an option to select the column type during import? It's a pain and it's confusing. I get that it's clever to do this interpretation, but the assumptions the tool is making (if a column is all 0, it must be checkboxes; if it's all 0.0 it must be a dropdown of 0s) don't make sense. Better to import it "vanilla" and let me decide where I want to get fancy.

    As pointed out, when I change a checkbox column to a number column, I get text "true" and "false" instead of the numbers I actually imported. In my example above, if I change column t3 to "text/number" it fills with "false" and then "=[t3]@row + [t4]@row" gives "false0" - clearly not useful!

    A

Hi @Alex Hackford<\/a> <\/p>

Maybe it's possible that the setting in photo below got switched accidently? Fingers crossed that's the issue as the fix is easy. It needs to be on \"Newly created sheets\".<\/p>

\n
\n \n \"image.png\"<\/img><\/a>\n <\/div>\n<\/div>\n

<\/p>


<\/p>


<\/p>


<\/p>


<\/p>


<\/p>

I hope that helps.<\/p>

Matt<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","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":[]},{"discussionID":111688,"type":"question","name":"Notifications - Will duplicate e-mails be sent?","excerpt":"I am setting up quite a few notifications on a sheet. Alerts need to go out to 'Contacts in a Cell' as well as 'specific people'. In some cases, the same person could fall in more than one notification contact categories and could also be in the 'Specific People' list. For example: Alert Contacts in a cell could be the…","snippet":"I am setting up quite a few notifications on a sheet. Alerts need to go out to 'Contacts in a Cell' as well as 'specific people'. In some cases, the same person could fall in more…","categoryID":321,"dateInserted":"2023-10-15T20:46:10+00:00","dateUpdated":"2023-10-16T22:28:11+00:00","dateLastComment":"2023-10-16T16:54:56+00:00","insertUserID":168164,"insertUser":{"userID":168164,"name":"Marianne Wilshynsky","title":"Project Executive","url":"https:\/\/community.smartsheet.com\/profile\/Marianne%20Wilshynsky","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-16T17:24:44+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"updateUserID":166028,"lastUserID":168164,"lastUser":{"userID":168164,"name":"Marianne Wilshynsky","title":"Project Executive","url":"https:\/\/community.smartsheet.com\/profile\/Marianne%20Wilshynsky","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-16T17:24:44+00:00","banned":0,"punished":0,"private":false,"label":"✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":2,"countViews":23,"score":null,"hot":3394879266,"url":"https:\/\/community.smartsheet.com\/discussion\/111688\/notifications-will-duplicate-e-mails-be-sent","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111688\/notifications-will-duplicate-e-mails-be-sent","format":"Rich","lastPost":{"discussionID":111688,"commentID":400169,"name":"Re: Notifications - Will duplicate e-mails be sent?","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/400169#Comment_400169","dateInserted":"2023-10-16T16:54:56+00:00","insertUserID":168164,"insertUser":{"userID":168164,"name":"Marianne Wilshynsky","title":"Project Executive","url":"https:\/\/community.smartsheet.com\/profile\/Marianne%20Wilshynsky","photoUrl":"https:\/\/us.v-cdn.net\/6031209\/uploads\/defaultavatar\/nWRMFRX6I99I6.jpg","dateLastActive":"2023-10-16T17:24:44+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":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-10-16T16:55:28+00:00","dateAnswered":"2023-10-16T16:30:41+00:00","acceptedAnswers":[{"commentID":400162,"body":"

@Marianne Wilshynsky<\/a> <\/p>

That person would get multiple notifications, because each alert is treated as a separate action. <\/p>

You could try using a helper column to reflect when the Assigned To is the same as the PM, APM, or Estimator, and use condition paths in your workflow to direct it down only one Action path.<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","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":[]},{"discussionID":111684,"type":"question","name":"Deleting a Column Through Global Update","excerpt":"Hello Community. I am looking to utilize Global Update in Control Center to delete a column. Global Update has options to add a column or modify a column but not seeing a clear path to delete a column. Has anyone had experience with this or perhaps confirm that it is not possible?","snippet":"Hello Community. I am looking to utilize Global Update in Control Center to delete a column. Global Update has options to add a column or modify a column but not seeing a clear…","categoryID":321,"dateInserted":"2023-10-15T12:22:47+00:00","dateUpdated":null,"dateLastComment":"2023-10-16T21:14:39+00:00","insertUserID":131805,"insertUser":{"userID":131805,"name":"Mike Ferringer","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Mike%20Ferringer","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!bCDcG6mES-Q!jEteY2AQwHQ!7LgDMUcu9rT","dateLastActive":"2023-10-16T21:27:38+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"updateUserID":null,"lastUserID":131805,"lastUser":{"userID":131805,"name":"Mike Ferringer","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Mike%20Ferringer","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!bCDcG6mES-Q!jEteY2AQwHQ!7LgDMUcu9rT","dateLastActive":"2023-10-16T21:27:38+00:00","banned":0,"punished":0,"private":false,"label":"✭✭✭✭"},"pinned":false,"pinLocation":null,"closed":false,"sink":false,"countComments":4,"countViews":23,"score":null,"hot":3394865846,"url":"https:\/\/community.smartsheet.com\/discussion\/111684\/deleting-a-column-through-global-update","canonicalUrl":"https:\/\/community.smartsheet.com\/discussion\/111684\/deleting-a-column-through-global-update","format":"Rich","tagIDs":[582],"lastPost":{"discussionID":111684,"commentID":400233,"name":"Re: Deleting a Column Through Global Update","url":"https:\/\/community.smartsheet.com\/discussion\/comment\/400233#Comment_400233","dateInserted":"2023-10-16T21:14:39+00:00","insertUserID":131805,"insertUser":{"userID":131805,"name":"Mike Ferringer","title":"","url":"https:\/\/community.smartsheet.com\/profile\/Mike%20Ferringer","photoUrl":"https:\/\/aws.smartsheet.com\/storageProxy\/image\/images\/u!1!bCDcG6mES-Q!jEteY2AQwHQ!7LgDMUcu9rT","dateLastActive":"2023-10-16T21:27:38+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":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B"}],"groupID":null,"statusID":3,"attributes":{"question":{"status":"accepted","dateAccepted":"2023-10-16T15:49:48+00:00","dateAnswered":"2023-10-16T13:49:35+00:00","acceptedAnswers":[{"commentID":400110,"body":"

There is no way to delete a column using global updates, but you can move it to the far right of the sheet and hide it using global updates.<\/p>"},{"commentID":400191,"body":"

I haven't seen anything regarding updating a column description anywhere.<\/p>


<\/p>

I don't have a way of testing this right now, but I wonder if you could add a new column from the template and have the column description carry over that way although that could mess with reporting if your \"new\" column is replacing an existing one.<\/p>"}]}},"status":{"statusID":3,"name":"Accepted","state":"closed","recordType":"discussion","recordSubType":"question"},"bookmarked":false,"unread":false,"category":{"categoryID":321,"name":"Smartsheet Basics","url":"https:\/\/community.smartsheet.com\/categories\/smartsheet-basics%2B","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":582,"urlcode":"global-updates","name":"global updates"}]}],"initialPaging":{"nextURL":"https:\/\/community.smartsheet.com\/api\/v2\/discussions?page=2&categoryID=321&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":5168,"limit":3},"title":"Trending in Smartsheet Basics","subtitle":null,"description":null,"noCheckboxes":true,"containerOptions":[],"discussionOptions":[]}">

Trending in Smartsheet Basics