smartsheet-apismartsheet-java-sdk-v2

How to update a row of cells in Smartsheet API 2.0


I recently wrote a program using the API 1.1 to automatically update a sheet and it uses the line

smartsheet.rows().updateCells(rowId, cells);

to update a row of cells in the sheet. In the 2.0 version rows() has been deprecated but I still can't find the 2.0 equivalent for this line.


Solution

  • updateCells() has been replaced by updateRows() and can be accessed using rowResources(). Detailed sample code is available here: http://smartsheet-platform.github.io/api-docs/#update-cell(s)

    Sample code:

    Row rowA = new Row.UpdateRowBuilder().setCells(cellsB).setRowId(rowId).build();
    
    List<Row> updatedRows = smartsheet.sheetResources().rowResources().updateRows(sheetId, Arrays.asList(rowA));