lisa-marie mueller

lisa-marie mueller

bullet pont

webhook node (to track ROI) link

January 22, 2021

ipad with title, clouds, neon letters - in orange Happy Friday! When you are trying to track ROI, you need data. One easy way to start gathering usage and ROI data is to set up a webhook with an application like Slack. The process is very similar to how we integrated a webhook in our plug-ins. If you haven’t used webhooks with Slack, check out their documentation.

inputs

We will have four inputs to the node: the name of the script, the telemetry URL, ROI information (in minutes), and an additional message. The telemetry URL will come from your Slack application and can be copied and pasted into a string node in Dynamo. When the script is run, we send a number of messages to Slack via the webhook. First we send the message that we started, then we take care of some formatting.

ROI message and user data

We reformat the ROI input from minutes to hours so we can compile it into one concise statement. Then we can concatenate the string to add the text entered in the message input.

There are a few pieces of additional information we want to collect: the username of the person running the script and the current date and time. We also declare our variable for the formatted message so we can combine all this information. Our formattedMessage will start by listing the name of the script (from the node input) and then the username and current date and time we just collected. We can then add our ROI message after. If there is other data you want to collect, you can customize the inputs and information to send additional data.

Now that we have our message with all the information we want to collect, we can create a StringContent object so that the library can correctly send our message. We pass through the message string, our string encoding (UTF8), and the data format (application/json). Then we can send it to our webhook URL. It will then post to the Slack channel that we have set up with our application. For our node, we want to return the message as a string so we know it ran successfully.

custom webhook node on Dynamo canvas

summary

When you need to collect some basic information on Dynamo script usage, you can use a node that sends data via webhook to an application like Slack. It is a fast and easy way to start tracking script usage and to collect ROI information.

Disclaimer: This post is intended to explain how to collect data relevant to tracking and understanding ROI. Please review any relevant privacy and protection policies before collecting data.

All products mentioned are used as examples for educational purposes only. Always confirm an application’s Terms of Use.

resources

If you want to learn to code and don’t know where to start check out my posts about Steps to Learn to Code [for architects and designers] Part 1 and Part 2.

Revit API Docs

bullet pont

recommended next