-
Notifications
You must be signed in to change notification settings - Fork 0
Home
tfarray edited this page Dec 15, 2016
·
5 revisions
- Copy the directory Smartsheet to C:\Program Files\WindowsPowerShell\Modules\
- Run powershell
Set-ExecutionPolicy bypass
Set-SmartSheetAPIToken [Your Token]
import-module smartsheet
$ss = get-smartsheet MySmartSheet
$ss.table | ft -autosize
if you want a graphical view, you can also do
$ss.table | Out-GridView
We have a sheet with 2 column : name, age I want to update the age of Thomas F. :
$Row = $ss.table | ? { $_.name -like "Thomas F." }
$Row.Age = 40
$Row.update()
I want to add a new row at the top of the smartsheet :
$NewRow = new-object psobject -property @{name = "Albert G."}
Add-SmartSheetRow $Row -SS $SS
I want to add a row just after Thomas F., and I want to use this Row as model
$ReferenceRow = $ss.table | ? { $_.name -like "Thomas F." }
$NewRow = new-object psobject -property @{name = "Albert G."}
# Method 1
Add-SmartSheetRow $NewRow -ReferenceRow $ReferenceRow -Placement siblingId
# Method 2
$ReferenceRow.AddRow($NewRow)
I want to add a new Child Row
$ReferenceRow.AddChild($NewRow)
If you want to see what is happening behind the scene, you may add -verbose to any command
Get-smartsheet MySS -verbose
you will then see the Jason data, the Web request ... and so on