- Overview
- Adobe Sign
- Alteryx
- Amazon Comprehend
- Amazon Connect
- Amazon Rekognition
- Amazon Textract
- Box
- Release notes
- About the Box activity package
- Fix XAML After Package Update
- Project compatibility
- Setup
- Technical references
- Box Scope
- Commit Session
- Create File Version Session
- Create Upload Session
- Upload Part
- Delete Old Version
- Get Versions
- Promote Version
- Upload File Version
- Copy File
- Delete File
- Download File
- Get File Comments
- Get File Info
- Get File Info Details
- Get File Lock Info
- Lock File
- Move File
- Unlock File
- Upload File
- Copy Folder
- Create Folder
- Delete Folder
- Get Folder Info
- Get Folder Items
- Rename Folder
- Search For Content
- Execute Method
- Cognitive
- DocuSign
- Release notes
- About the DocuSign activity package
- Project compatibility
- Setup
- DocuSign Scope
- Invoke DocuSign Operation
- Create Envelope
- Create Envelope And Send
- Create Envelope From Template
- Create Envelope Recipients
- Get Document
- Get Documents
- Get Envelope
- Get Form Data
- Send Envelope
- Update Envelope
- List Attachments
- List Custom Fields
- List Documents
- List Envelope Status Changes
- List Recipients
- Create Bulk Send List
- Create Bulk Send Request
- Get Bulk Send List
- Get Bulk Send Lists
- Create Template Custom Fields
- Create Template Recipients
- Get Template
- List Templates
- Google Vision
- Jira
- Release notes
- About the Jira activity package
- Project compatibility
- Setup
- Jira Scope
- Execute Method
- Add Attachment
- Delete Attachment
- Download Attachment
- Get Attachments
- Add Comment
- Delete Comment
- Get Comments
- Create Component
- Delete Component
- Get Components
- Search Dashboards
- Create Filter
- Get Filters
- Create Issue Link
- Delete Issue Link
- Get Issue Link Types
- Get Issue Links
- Add Watcher
- Assign Issue
- Clone Issue
- Create Issue
- Delete Issue
- Get Issue
- Get Watchers
- Remove Watcher
- Search Issues Using JQL
- Transition Issue
- Update Issue
- Create Project
- Delete Project
- Get Project Types
- Get Projects
- Update Project
- Get Transitions
- Create User
- Delete User
- Find Users
- Marketo
- Microsoft Dynamics
- Microsoft Dynamics Finance and Operations
- Microsoft Translator
- Microsoft Vision
- Oracle Integration Cloud
- Oracle NetSuite
- Salesforce
- Release notes
- About the Salesforce activity package
- Project compatibility
- Setup
- Quickstart
- Salesforce Application Scope
- Create Bulk API Job
- Get Bulk API Job
- Get Bulk API Job Results
- Start or Abort Bulk API Job
- Assign File
- Download File
- Upload File
- Composite Request
- Delete Record
- Get List View Records
- Get Record
- Insert Record
- Update Record
- Upsert Record
- Execute Report
- Execute SOQL
- Format Column Names
- Format Labels And Values
- Lightning REST API Request
- Search
- SAP BAPI
- ServiceNow
- Slack
- Smartsheet
- Release notes
- About the Smartsheet activity package
- Project compatibility
- Setup
- Technical references
- Quickstart: Working With Rows
- Smartsheet Application Scope
- Attach File
- Attach URL
- Delete Attachment
- Get Attachment
- List Attachments
- Add Comment
- Delete Comment
- Get Comment
- List Discussions
- Copy Folder
- Create Folder
- Delete Folder
- Get Folder
- List Folders
- Add Group Members
- Get Group
- List Groups
- Remove Group Member
- Get Report
- List Reports
- Add Rows
- Copy Rows
- Create Discussion on Row
- Delete Rows
- Get Row
- List Rows
- Move Rows
- Update Rows
- Copy Sheet
- Create Sheet
- Create Sheet From Template
- Download Sheet
- Get Sheet
- List Sheets
- Update Sheet
- Add User
- Get User
- List Users
- Remove User
- Copy Workspace
- Create Workspace
- List Workspaces
- Import Sheet From CSV / XLSX
- Invoke Smartsheet Operation
- Search Activity
- Send Via Email
- Share Object
- SuccessFactors
- Tableau
- Twilio
- Workato
- Workday
Quickstart: Working With Rows
The purpose of this guide is to walk you through several examples of how to work with Rows on a Sheet in Smartsheet. We will use the following activities:
This working sample enables you to Get a list of rows then iterate through that list of rows, first getting any attachments for that row and then updating a value in that row.
After completing the steps in this guide, you'll have an automation sequence that does the following:
- Establishes a connection to your Smartsheet instance (Smartsheet Scope).
- Gets a list of rows from a sheet (List Rows).
- For each row retrieved, do the following:
- Get the attachments for that row (List Rows).
- Downloads any attachments on that row Get Attachment.
- Updates the value of that row Update Rows.
For item 4 above, we could instead opt to create a Row[] object and make a single Update call, but for the purposes of this demo will will call it once for each Row that we want to update.
Below is a screenshot of what our sample Sheet looks like.
To get your Sheet ID go to File->Properties and see the SheetID. It should look something like 5903706102228868.
Before you begin:
- Complete the Smartsheet Setup steps.
- A local folder path to download attachments to.
Build your project
- Create and enter a
String
variable for your API Token value (e.g., apiToken). - Add the Smartsheet Scope.
- For Authentication Type, choose API Token.
- Enter your apiToken variable as the value for the API Access Token value.
Create and set variables that will be used in several activities
- Create and enter an
Int64
variable for your SheetId value (e.g., sheetId). - Create and enter a
String
variable for your Download Path value (e.g., downloadPath).
Get a List of Rows that we want to get attachments for and also update, and set up a for each loop.
- Add the List Rows activity.
- Click the Configure button inside the List Rows activity.
- For the field Sheet Id, enter your sheetId in to the Value column.
- For the field Rows, create a
Row[]
variable (e.g., rowsRetrieved). - Click the Done button.
- Add a For Each activity after the List Rows activity.
- For the Values property, enter your rowsRetrieved variable.
- For the Type Argument property, use
Smartsheet.Api.Models.Row
. - In the body of the For Each activity, add a List Rows activity.
- For SheetId enter your sheetId variable.
- For RowId enter "item.Id.value".
- For Include choose "Attachments" as an option.
-
For Row, create and enter a
Row
variable (e.g., rowRetrieved)
Set up an If condition check
- Add an If* Activity after the Get Row activity.
- For the Condition use the value "RowRetrieved.Attachments is Nothing".
- In the Else section of the If activity, add a For Each Activity
- In the For Each activity, set the following properties:
- For Values, set it to rowRetrieved.Attachments (presuming you are using rowRetrieved as your output variable per 7d above).
- For TypeArgument set it to "Smartsheet.Api.Model.Attachment"
- Rename the ForEach variable from item to attachment.
For each row with an attachment, download the attachment and update a value on that row
- Add a Get Attachment activity.
- For SheetId, enter your sheetId variable.
- For AttachmentId, enter "attachment.Id.Value"
- For Download Folder Path, enter your downloadPath variable.
- Add an Assign activity after the Get Attachment activity
- For To, create a
Row
variable (e.g., rowUpdate). -
For Value, create a new
Row
object and set it using code similar to the pattern below.New Row() With { .Id = RowRetrieved.Id, .Cells = New List(Of Cell) From { New Cell() With {.Value = '100', .ColumnId = RowRetrieved.Cells(3).ColumnId} } }
New Row() With { .Id = RowRetrieved.Id, .Cells = New List(Of Cell) From { New Cell() With {.Value = '100', .ColumnId = RowRetrieved.Cells(3).ColumnId} } } - Add an Update Rows activity after the Assign activity.
- Click the Configure button.
- For the Sheet Id field, use the sheetId variable.
- For the Rows field, click on the Row link button.
- Click on the Add button
- Enter the rowUpdate variable that you created earlier.
- Click the Done button
You're done!
To learn more about the Smartsheet activities (including example property inputs/outputs), see the Activities page for a complete activity list and links to the activity detail pages.
You can download a copy of this robot at the following link: