Importing a .csv file as a smartsheet via the API

Ray.C
Ray.C
edited 12/09/19 in Smartsheet Basics

Hi,

When I import a .csv file via the API, some of the column types are thrown off. I have one column that is strictly text (should have the type TEXT_NUMBER), but smartsheets is assigning that column the column_type PICKLIST. How do I prevent this from happening during import? Having to always import, then find the column_id that I want to update, and then updating via the API isn't ideal.

 

Thanks!

Comments

  • dAVE Inden
    dAVE Inden Employee

    Do any of the values in the column repeat? Do you see this same behavior happen when importing in Smartsheet in your browser? When importing a CSV file where a column has the same collection of values going down the whole row the column will be turned into a Dropdown column or PICKLIST for the API with the collection of values as the options for the Dropdown column.

    For example, if your column has "Not Started," "In Progress," and "Complete" as the values all the way down with varying amounts of each that column would be imported as a Dropdown column with the options being "Not Started," "In Progress," and "Complete."

    There isn't a method to override this behavior importing via the API.

  • What would the reason be for a column being imported as a CHECKBOX when all the values are numeric integers {0,1,2,6,14....etc...}?

     

     

  • dAVE Inden
    dAVE Inden Employee

    I haven't been able to reproduce this behavior myself with a column coming in as a Checkbox type when there is integers entered in it. It might be due to some formatting of the column in Excel? To troubleshoot this more directly with you I'd suggest reaching out to the Support team and they can help you.

  • JeremiahHorstick
    JeremiahHorstick ✭✭✭✭✭✭

    After importing the csv you can explicitly set the column type. Get the sheet and then iterate through the column list using column update. 

    Look me up if you want any help

    -Jeremiah Horstick