Smartsheet API and Automation Rules

Options

Hi all,

I'm having some difficulty using the smartsheet API with Python.

I am trying to use smartsheet_client.Sheets.copy_sheet(...) to copy a particular sheet by its ID and copy it to a new destination folder. It works fine, I can create the sheet in the new location and with a new name, carrying over whatever data was in it.

The problem is this sheet has some automation rules, which are supposed to sort of "archive" the sheet, save some rows from it to another sheet every so often to keep a record.

The automation rules break and say 'workflow is invalid' in the new sheet every time I copy a sheet with Python, even if I use the token of the person who has full access including to the archiving destination sheet.

Answers

  • jmyzk_cloudsmart_jp
    jmyzk_cloudsmart_jp ✭✭✭✭✭✭
    Options

    Hi @Dorset

    You are right.

    I tested using Python SDK and found copied sheet's workflow does not copy the target sheet name for copy or move action and shows <unknown sheet>.

    I must manually edit the copy or move the workflow to change the destination sheet name.

    To simplify the editing, you could make a field in Sheet Summary, workflow destination sheet name, for example.

    😀

  • Dorset
    Dorset ✭✭
    Options

    Thanks for your reply @jmyzk_cloudsmart_jp !


    Yes you've found my issue. I found this discussion https://community.smartsheet.com/discussion/68744/automation-based-on-sheet-summary which states there is no way to use sheet summary data within automation. This appears to be the case, when I click <unknown sheet> I can't use any logic, I can only select a sheet.

    I thought one fix could be to let the automation rules break and then use update_automation_rule(..) and perhaps the 'action' field to change the contents of that <unknown sheet> box, giving it the destination sheet ID again. I'm unsure of the exact syntax.


    The next problem is that this is a newly copied and created sheet, so I can't hard code the ID of the automation rule, and when I use list_automation_rules(..) in attempt to obtain the ID it only gives me one of the rules (the very last one), where I have 6, see below. And I tried creating new unbroken rules, making them active and inactive, it didn't make any difference.



  • jmyzk_cloudsmart_jp
    jmyzk_cloudsmart_jp ✭✭✭✭✭✭
    Options

    Hi @Dorset

    Unfortunately, Smartsheet API does not support creating or updating workflow automation rules except for approvals, notifications, and update requests.

    https://smartsheet.redoc.ly/tag/automationRulesDescription

    The lack of API support for all workflow rules is a significant disappointment. FYI, Smarthseet API supports 'forms,' neither.

    The use of a Sheet Summary field, I suggested, is for manual editing of the workflow rule, not for API use.

    If you copy a sheet manually, the copied sheet has valid workflows, including a copy or move rows action. So, consider the trade-off of manually coping sheets and manually editing workflows.

  • Dorset
    Dorset ✭✭
    Options

    @jmyzk_cloudsmart_jp ,


    Definitely not the greatest news for my project but nonetheless thanks so much for your knowledge on the topic and saving me a lot of time spent trying to make it work.

  • samueljlawson
    Options

    The more I see, the more I realise Smartsheet is not a complete product. No support for Reports. Only partial support for Dashboards, and hardly anything for automation rules and workflows. This API is not a version 2.0, it should be labelled 0.2


    I hate to resort to this, but has anybody tried Selenium for these?