Error 1008...

Hi Everyone,

Ive been trying to automate a couple of imports to our smartsheet. Long story short, it is a JS script that takes a xlsx file extract taa from it and exports it to smartsheets. TBH ive been working on this project on and off for at least 4 months. As of now, the latest error im getting is this:

Error adding rows to Smartsheet: {

  errorCode: 1008,

  message: 'Unable to parse request. The following error occurred: Unknown attribute "rows" found at  line 1, column 26',

  refId: 'mmg1bl'

}


Apparently there is an error on the format that is being used, is there a standard, if so where could I find documentation in regards to it?

Also, Im using Axios...

Answers

  • BKing
    BKing ✭✭✭

    Sorry this is c#, however:

    We create a list of cells

    List<Cell> accRowCells = new();

    Then for each cell you need in you xlsx row add a cell to the list:

          Cell clientCell = new()

          {

            ColumnId = GetColumnId(APDSiteSmartsheetSchema.ACC_LINK_COL_CLIENT),

            Strict = false,

            Value = "value from you cell"

          };

          accRowCells.Add(clientCell);

    GetColumnId - it just maps column header text to a column id

    Once you have processed all the cells in your xlsx row, create a Smartsheet row object:

            var row = new Row

            {

              Cells = accRowCells

            };

            rowsToUpdate.Add(row);

    Note we are using a list of rows so we can process the whole xlsx file and batch update the Smartsheet.

    its is defined as - List<Row> rowsToUpdate = new();

    Finally, add the new rows to your Smartsheet:

            IList<Row> newRow = smartsheet.SheetResources.RowResources.AddRows(

             sheetId, rowsToUpdate);

    Hope this helps,

    Brian