Hi Everyone,
I am currently trying to integrated SharePoint data into smartsheet.
However, I am struggling with data types and most of the cells do not take my values.
I think I have no issue with certain type like TEXT_NUMBER or DURATION but for the other types I am stuck.
Can someone show me an example of how to insert such rows?
Thanks a lot in advance!!
Please find some details in below:
Here are my columns: (Type | Column Name)
TEXT_NUMBER | Task Name
DURATION | Duration
ABSTRACT_DATETIME | Start
ABSTRACT_DATETIME | Finish
PREDECESSOR | Predecessors
CONTACT_LIST | Assigned To
TEXT_NUMBER | % Complete
PICKLIST | Status
TEXT_NUMBER | Comments
Here is an example of data I am trying to insert: (all string)
Task Name|Intranet
Duration|1d
Start|1d
Finish|1d
Predecessors|9
Assigned To|patrick
% Complete|0d
Status|In progress
Comments|test
Here is my code:
// build row
// Specify cell values for row
Cell[] cells = new Cell[] {
new Cell
{
// Task name
ColumnId = xxxxx49386104708,
Value = title
},
new Cell
{
// Duration
ColumnId = xxxx49851891588,
Value = duration
},
new Cell
{
// Start
ColumnId = xxxxxxx479262084,
Value = start
},
//new Cell
{
// Finish
ColumnId = xxxxxxx5576836,
Value = finish
},
//new Cell
{
// Predecessors
ColumnId = xxxxxxxx2947332,
Value = predecessors
},
new Cell
{
// Assigned To
ColumnId = xxxxxx898470276,
Value = assignedTo
},
new Cell
{ // Status
ColumnId = xxxxxxxxx712155524,
Value = status
},
new Cell
{ // % Complete
ColumnId = xxxxxxxxx5840772,
Value = complete
},
new Cell
{ // Comments
ColumnId = xxxxxxxxx526020,
Value = comments
}
};
// Specify contents of row
Row row = new Row
{
ToTop = true,
Cells = cells
};
// Add rows to sheet
IList<Row> newRows = ss.SheetResources.RowResources.AddRows(
currentSheetId, // long sheetId
new Row[] { row } // IEnumerable<Row> rowsToAdd
);