Welcome to the Smartsheet Forum Archives
The posts in this forum are no longer monitored for accuracy and their content may no longer be current. If there's a discussion here that interests you and you'd like to find (or create) a more current version, please Visit the Current Forums.
Website form integration using API
I am attempting to use the API to add comments into a new row created by a form submission. I am currently adding new rows to sheets through forms on our website that integrate with (amung other things) the Smartsheet API. Our website utilizes C# so I am using the following code (partial) to submit to a sheet.
Cell[] cellsA = new Cell[] {
new Cell.AddCellBuilder(17217962705xxxxx, DateTime.Now).Build(),
new Cell.AddCellBuilder(265336235xxxxx, firstName.Text).Build(),
new Cell.AddCellBuilder(265336235xxxxx, lastName.Text).Build(),
new Cell.AddCellBuilder(7333807385xxxxx, phone.Text).Build(),
new Cell.AddCellBuilder(17043078515xxxxx, email.Text).Build(),
new Cell.AddCellBuilder(8459707292xxxxx, issue.Text).Build()
};
// Specify contents of first row.
Row rowA = new Row.AddRowBuilder(true, null, null, null, null).SetCells(cellsA).Build();
// Add rows to sheet.
smartsheet.SheetResources.RowResources.AddRows(73123464072xxxxx, new Row[] {rowA
});
So my question is: how do I add to the Comments row in my Smartsheet? If I am reading the API documentation correctly, I need the row ID but as this is adding a new row, there is none at this point. So:
1. How can I get the Row ID from the row I am creating?
2. How then can I use an additional process to add comments to that row?
Any help would be appreciated.
Comments
-
I think you mentioned this in another post. But, you would have to do this in multiple requests. In the response you receive from the successful request of adding the row there will be an id of the newly created row. You can store this for later use in your next request to add the discussion information to the new row.
There is an example of the response received from a successful request in the docs on adding a new row:
http://smartsheet-platform.github.io/api-docs/?csharp#add-row(s)
Categories
- All Categories
- 14 Welcome to the Community
- Smartsheet Customer Resources
- 63.9K Get Help
- 410 Global Discussions
- 220 Industry Talk
- 457 Announcements
- 4.8K Ideas & Feature Requests
- 143 Brandfolder
- 136 Just for fun
- 57 Community Job Board
- 459 Show & Tell
- 31 Member Spotlight
- 1 SmartStories
- 298 Events
- 37 Webinars
- 7.3K Forum Archives