ShareReport
Shares a report with a user or group in your Smartsheet account.
Procedure Specific Information
Note: The Id output parameter won't contain any values, if the report has already been shared previously (with the same member).If the rules specified below are not followed, the procedure will fail with an error.
Parameter groups
When executing this stored procedure, exactly one group from the following group of parameters must be specified:Single-share group
Use this group when you want to share the report with a single member.- UserEmail or GroupId (but not both)
- AccessLevel
Multi-share group
Use this group when you want to share the report with multiple members.- MultiShareAggregate
MultiShareAggregate
The value provided for the MultiShareAggregate parameter must be an array of JSON objects in the following format:[
{
"userEmail": "[email protected]",
"accessLevel": "VIEWER"
},
{
"groupId": 123456,
"accessLevel": "EDITOR"
},
// ...
]
In more detail:
- The array must contain at least one valid share object.
- For each share object in the array, either the userEmail or the groupId field must be specified (but not both).
- For each share object in the array, the accessLevel field must be specified.
- For each share object in the array, the value provided for the accessLevel field must be one of the values documented in the AccessLevel parameter's description below.
Email parameters
The following parameters can be used to configure the email that is sent to the members with which the report is shared. They can be used only when SendEmail=true.- CcMe
- EmailSubject
- EmailMessage
Examples
For examples on how to use this stored procedure, refer to the following queries:-- Single Share
EXECUTE ShareReport ReportId = '3947571576786820', UserEmail = '[email protected]', AccessLevel = 'VIEWER';
-- Multi Share
EXECUTE ShareReport ReportId = '3947571576786820', MultiShareAggregate = '[{"userEmail":"[email protected]","accessLevel":"VIEWER"},{"userEmail":"[email protected]","accessLevel":"EDITOR"}]', SendEmail = true, CcMe = true, EmailSubject = 'Sharing an asset', EmailMessage = 'You can find the shared asset attached to this email.';
Input
| Name | Type | Required | Description |
| ReportId | String | True | The unique identifier of the report being shared. |
| UserEmail | String | False | The email of the user to share the report with. |
| GroupId | String | False | The unique identifier of the group to share the report with. |
| AccessLevel | String | False | The access level for the user or group on the shared report.
The allowed values are ADMIN, COMMENTER, EDITOR, EDITOR_SHARE, VIEWER. |
| SendEmail | Boolean | False | Boolean value indicating whether to notify the user or group about the shared report with an email. |
| CcMe | Boolean | False | Boolean value indicating whether to send a copy of the email to the sharer of the report. |
| EmailSubject | String | False | The subject of the email for the shared report. |
| EmailMessage | String | False | The message of the email for the shared report. |
| MultiShareAggregate | String | False | A JSON array of share objects, containing the information required for sharing the report with multiple members. |
Result Set Columns
| Name | Type | Description |
| Success | Boolean | A boolean value indicating whether the operation was successful. Returns 'true' if the report was shared successfully, and 'false' otherwise. |
| Id | String | The unique identifiers of the shares that were created in CSV format. |