Webhooks vs Built-In Automation

I know that automated workflows in smartsheet won't take place if the trigger is a change on a cell link. Will the same happen in the case of when a webhook is triggered? Will a webhook send if the trigger is a cell linked column?

Answers

  • I tested and webhooks will work with cell links unlike automated workflows.

  • Lucas...would you be able to discuss how you were able to get webhooks to do more with automation? I'm running into an issue where I need cell linking and formulas to trigger automation and I'm running into roadblocks. Thanks in advance! Rob

  • Lucas Argueza
    Lucas Argueza ✭✭
    edited 03/10/21

    @Rob Laguerre I ended up not using webhooks because this solution was more complex and required more overhead than necessary for my problem. I'll try my best to give some insight. Not the greatest at technical explanations so bear with me lol.

    Just a heads up. I followed the sample on smartsheet's github page to test webhooks and once I got that working, I understood how to use webhooks for automation. https://github.com/smartsheet-samples/node-webhook-sample This will help you create and enable your first webhook and get responses whenever changes are made.

    Webhook responses will look like this:

    {
      "nonce": "4b2ed20d-6f00-4b0c-8fac-082182aa9aac",
      "timestamp": "2015-10-27T17:04:23.795+0000",
      "webhookId": 4503604829677444,
      "scope": "sheet",
      "scopeObjectId": 4509506114742148,
      "events": [
        {
          "objectType": "sheet",
          "eventType": "updated",
          "id": 4509506114742148,
          "userId": 9007194052434043,
          "timestamp": "2015-10-27T17:03:15.000+0000"
        },
        {
          "objectType": "row",
          "eventType": "created",
          "id": 7129509179746180,
          "userId": 9007194052434043,
          "timestamp": "2015-10-27T17:03:15.000+0000"
        }
      ]
    }
    

    via https://smartsheet-platform.github.io/api-docs/#webhook-callbacks

    Once you have your server-side app running and get a response, you can decide whether the type of event is something worth looking into. For example, if you're trying to act on a cell change, you will ignore all other "objectType"s unless it is "cell" and "eventType" is "updated" and then you proceed with the information for that event. For cell updates, you'll also received the row and column id for that cell so you can create more conditionals to see if that event is a trigger or not. If an event happens to be a trigger, you'll have to use whatever the response gives you in order to make your automation happen using the API. I found it pretty tricky to workaround since you'll probably be making a lot of API requests. On top of getting it to work locally, if you want it to run constantly, you'll need to deploy it on a server and get a url for the app which is why i decided not to ditch it. Anyways, I suggest reading the API documentation and running their sample code. I'm by no means an experienced coder so I think you could do it. Hope this helps.