java - How to move a sheet with smartsheet api -


when create new sheet using smartsheet java api created in "sheets" folder under home. possible move sheet or create in different workspace/folder?

below have listed example on how create sheet in new folder how copy existing sheet new folder. if want move sheet new folder can first copy sheet new folder , delete original sheet.

please note, both sheet id , folder id can retrieved right clicking on sheet or folder inside smartsheet , clicking properties.

create sheet in folder

string token = "your_token"; smartsheet smartsheet = new smartsheetbuilder().setaccesstoken(token).build();  // define sheet copy sheet sheet = new sheet(); sheet.setname("new sheet");  // create columns new sheet list<column> columns = new arraylist<column>(); column column = new column(); column.settitle("column #1"); column.setprimary(true); column.settype(columntype.text_number); columns.add(column);  column column2 = new column(); column2.settitle("column #2"); column2.settype(columntype.text_number); columns.add(column2); sheet.setcolumns(columns);  // define folder put sheet in long folderid = 907281073235844l;  // create new sheet , put in specified folder sheet newsheet = smartsheet.sheets().createsheetinfolder(folderid, sheet); system.out.println(newsheet.getid()); 

copy sheet new folder

string token = "your_token"; smartsheet smartsheet = new smartsheetbuilder().setaccesstoken(token).build();  // define sheet copy sheet sheet = new sheet(); sheet.setfromid(7298027523204996l); // define folder put sheet in long folderid = 907281173235844l;  // copy sheet specified folder sheet newsheet = smartsheet.sheets().createsheetinfolder(folderid, sheet); system.out.println(newsheet.getid()); 

delete existing sheet

string token = "your_token"; smartsheet smartsheet = new smartsheetbuilder().setaccesstoken(token).build();  smartsheet.sheets().deletesheet(1758379303587716l); 

Comments

Popular posts from this blog

yii2 - Yii 2 Running a Cron in the basic template -

asp.net - 'System.Web.HttpContext' does not contain a definition for 'GetOwinContext' Mystery -

mercurial graft feature, can it copy? -