So, when creating a new Smartsheet from a Template that has Automated Workflows there are some options that must be selected for the Smartsheet to inherit that automation.
The Smartsheet API has built in Inclusion Parameters (Rules and RuleRecipients) that can be passed into a request to serve the same function as what we see in the form above.
INCLUSION PARAMETERS AVAILABLE IN THE SMARTSHEET API
Parameters include (optional) -- comma-separated list of elements to copy from the template or sheet:
The smartsheet-csharp-sdk(v2.126.0) we are using to create the API calls has baked in Inclusion classes with preset parameters. Unfortunately, these Inclusion classes do not contain the Rules and RuleRecipients parameters.
INCLUSION PARAMETERS IN SDK (Relevant ones)
// Summary:
// Represents specific elements that can be copied from a Template or Sheet into
// a new Sheet.
public enum TemplateInclusion
{
//
// Summary:
// Includes the data.
DATA = 0,
//
// Summary:
// Includes the attachments.
ATTACHMENTS = 1,
//
// Summary:
// Includes the discussions.
DISCUSSIONS = 2,
//
// Summary:
// Includes the cell links.
CELL_LINKS = 3,
//
// Summary:
// Includes the forms.
FORMS = 4
}
// Summary:
// Represents specific elements to include in a response.
public enum SheetLevelInclusion
{
//
// Summary:
// Includes sheet-level and row-level attachments.
ATTACHMENTS = 0,
//
// Summary:
// Includes columnType attribute in the row’s cells indicating the type of the column
// the cell resides in.
COLUMN_TYPE = 1,
//
// Summary:
// contact references
CONTACT_REFERENCES = 2,
//
// Summary:
// cross sheet references
CROSS_SHEET_REFERENCES = 3,
//
// Summary:
// Includes sheet-level and row-level discussions.
DISCUSSIONS = 4,
//
// Summary:
// Includes column filters and row.filteredOut attribute.
FILTERS = 5,
//
// Summary:
// Includes column filter definitions
FILTER_DEFINITIONS = 6,
//
// Summary:
// Includes column, row, and cell formatting.
FORMAT = 7,
//
// Summary:
// object representation of cell value
OBJECT_VALUE = 8,
//
// Summary:
// Includes the owner’s email address and user Id for each sheet.
OWNER_INFO = 9,
//
// Summary:
// Includes a permalink attribute for each row. A row permalink represents a direct
// link to the row in the Smartsheet application.
ROW_PERMALINK = 10,
//
// Summary:
// (DEPRECATED: use WRITER_INFO) Includes createdBy and modifiedBy attributes on
// the row, indicating the row’s creator and last modifier.
ROW_WRITER_INFO = 11,
//
// Summary:
// Includes the source object indicating which sheet or template the sheet was created
// from, if any.
SOURCE = 12,
//
// Summary:
// Includes SheetSummary object.
SUMMARY = 13,
//
// Summary:
// Includes createdBy and modifiedBy attributes on the row or summary fields, indicating
// the row or summary field's creator, and last modifier.
WRITER_INFO = 14
}
The CreateSheetFromTemplate method that we are using from the SDK does have an "includes" parameter but it only accepts an IEnumerable of the pre-built TemplateInclusion.
Sheet CreateSheetFromTemplate(long workspaceId, Sheet sheet, IEnumerable<TemplateInclusion> includes);
I am not sure how to bypass this to add the Rules and RuleRecipients parameters in a way that would work with the SDK. Is it possible to create a Smartsheet that will inherit the Automated Workflows from a Template using the SDK? Or should I just bypass it altogether and create a traditional API call?
I checked the source code of the package (https://github.com/smartsheet-platform/smartsheet-csharp-sdk) and the TemplateInclusion never included once rules or ruleRecipients. I tried to force the call using rest api and rules are supported, but i doubt that rulesRecipents are...
url : https://api.smartsheet.com/2.0/sheets?include=rules,rulesrecipients,recipients
body : {"name":"newsheetFromTemplate", "fromId": 9999999999}
To conclude i would advise: