AddColumns() public method

Inserts one or more columns into the Sheet specified in the URL.

It mirrors To the following Smartsheet REST API method: POST /sheets/{sheetId}/Columns

if any argument is null or empty string if there is any problem with the REST API request if there is any problem with the REST API authorization (access token) if the resource cannot be found if the REST API service is not available (possibly due To rate limiting) if there is any other error during the operation
public AddColumns ( long sheetId, IEnumerable columns ) : IList
sheetId long the sheet Id
columns IEnumerable the column object(s)
return IList
Example #1
0
        public virtual void TestAddColumn()
        {
            server.setResponseBody("../../../TestSDK/resources/addColumn.json");
            Column col1 = new Column.AddColumnBuilder("New Picklist Column 1", 4, ColumnType.PICKLIST).Build();
            Column col2 = new Column.AddColumnBuilder("New Picklist Column 1", 1, ColumnType.PICKLIST).Build();

            col1.Options = new List <string> {
                "First", "Second", "Third"
            };

            IList <Column> newCols = sheetColumnResourcesImpl.AddColumns(1234L, new List <Column> {
                col1, col2
            });

            Assert.AreEqual(150, newCols[0].Width);
            Assert.IsTrue(newCols[0].Type == ColumnType.PICKLIST);
            Assert.IsTrue(newCols[0].Index == 4);
            Assert.IsTrue(newCols[2].Id == 6755394238748795);
            Assert.IsTrue(newCols[2].Title == "New Picklist Column 2");
            Assert.IsTrue(newCols[2].Options[1] == "2");
        }