On Demand Webinars
Chain integrations with webhooks in monday.com (2022)
1,115 views
View transcript
Along the lines of this scenario. This is the scenario that we trigger a bit more complex, but it also does more things right. As always, we have our webhook trigger. We go into this scenario. This is the first thing we do. We change to generating. This is the same way we have done before. But instead of just writing back our finalized data, we simply update the column. That was our trigger column. We know which item that was on. We know which column it is, and we know we want to change it to generating. So that's the first thing we do to say the scenario has started. After that, you don't have to go to super deep detail on this one, but it's simply that we list the templates for that we looked at a few moments ago. We filter out through these filters. We filter out that the statuses in both boards must match. What mean by that is. As you saw, we have here template one, two and three. We want to actually get back the right template. So in the templates board we also have this template one, two and three. All of this is mapped dynamically through mappings. And simply what we have here is a filter that says this state is from module three, which is list templates or templates. Board must be equal to the actual value from our webhook. So from our webhook we have the value of the status that was our trigger. These texts need to match. This is how we know that this is the right template. Or possibly if the template doesn't exist, it will also stop this execution here. So this is also kind of a validation thing here as well. Next part is really just simple. It's we're going to iterate through -the template tasks. -Yeah. And this since we are iterating the sub items, right. This is exactly as listen up note because this is exactly what you would do on a connected item as well. It's handled the same way. So what we have here is after we matched the correct template, we found out like, okay, we got a match. This is the template. In this case, it was template one. Now what it gives us is this main item, right? But we're interested in the sub items. So what we do here is since we got the main item from this module, the list templates here we use an iterator. And yes, you can see here it uses module three and takes the sub items, which is an array of sub item IDs. It's not the entire sub items with its values, but it's the unique identifiers in a list of the sub items. And that's actually what the bracket means, right? So the bracket actually is where it's an array. So it's a package of things. Oh, that's exactly. So what we do here with the iterator, what this simply does is you give it a list or an array and it's going to go through each item of the list and each item is going to give its own signal or pulse or it's also called a bundle. That's what it's called in make and do all the modules that follows. The iterator will be run once for every item in the list that you put in the iterator. So what we want to do here is first we want to get the task item and this task item is the sub item from the task template board. We get our example item and then we create the same item in our board where we actually triggered this entire scenario. We get it. We create it. That's it. Go to the next part in the list. Get that item and create it where we want it. And then rinse and repeat for however many times -you need. -Exactly. This is also completely dynamic. If you have two task template sub items or if you have 50 doesn't matter because we're only going to iterate through each one once. And in the end here we also added this change to generated. This is a bit extra maybe. Beyond. But the reason that I didn't put this simply here is, well, one, since this runs once for every sub item, this one would run for each sub item and two, we want it to be run after everything is done. So here we have a router which all you need to know is the top part -will always run first. -And now we actually have an interesting question for Matthew. When you use this templating function to create new sub items. Is it possible to copy updates as well and what Matthew is actually thinking of here? Can he copy a checklist already made in one and put -it in the new task? -Uh, short answer is yes. You can copy updates. I will warn you, though, that this is a fairly complex thing to do. It will require some some custom calls, but it is possible. As far as I assume by checklist, you knew you need that native functionality where you can actually check the things and you can see from the actual item. Yeah, that part I haven't personally tried out myself. I would think that it's possible. But I can't tell you for sure. But in either case, it's really. Yes, it's possible. It's not one of the standard things that are done and therefore there's no standard module for it. Again, I would also redirect you to look to the Monday documentation, search for updates, and you will find more there in how you could accomplish this. But it is possible and you have done -it so. -So Lucas, this is really nice, but isn't there actually native functionality in Monday for this rather specific thing? There sure is. So let's actually look at how this could look if we use Native. We'll also just quickly, since we're running through here, just making sure. Yeah, they were indeed created and they did indeed trigger the next scenario to assign the task numbers. But yeah, let's look at Frederick West. You said this is possible to do with native automations. For example, we have pre-made some here that we can actually they're currently turned off just so we wouldn't get duplicate triggers here. But you can do something along the lines of this. When generate template or start a status column changes the template one. Then we're going to create the first sub item template one, task one, and then we're going to create the next sub item and then we're going to create the next sub item. As you might already hear, this gets pretty hard to administer. Yeah, because they're never going to be called anything but sub item. -Right, exactly. -And if you are, if you want to add more sub items to it or detract, then you basically need to duplicate it and make it a new one and so on and so forth. Right. So let's say you have 50 sub items here and you're like, I actually want to change the name of my 23rd. That's like, it is possible, but it's really annoying to do. Or as Fredrik said, I want to add a new one or such something along those lines. It's pretty hard to administer even though it is possible. And also, as you will see here, you will also need one recipe for each template you add. Comparing that to our template. For now, we can very easily add items just if we want to add a new item. That's all we do after that. Now we will also from each generation for template three. Now, from now on, it will also add this new item. We can also add new templates really quickly. We add a new template and we're just going to add a new label here. And that's it. This is a very user friendly way as well to do something like templates and just not talking about specifically templates. This is also something along the lines of what we can do with webhooks to take something that might either already be possible in Monday and make it even better, or just take something that's not even possible to do with native automations and create functionality that isn't out of the box. Yeah. And staying on the track of templates in this case. Yeah, you can input some information in those sub items, but you can't input anything and we can actually go in here and actually be really creative with what kind of values we input. Yeah. In those and we, and you could even do such a thing. So yeah, create this one but in this task actually make a calculation from a few numbers you have in the main item and put that back in so you can be really crazy with how far you take that. You really can. You can even do stuff like you can implement as much logic as you want here. You can do something like if this template is created from this board or this department, assign this person and this column like it already gets a bit hard to just keep in your head. But it you really can do a lot of things and just make this functionality super complex and super helpful to in the end, hopefully just really simplify the workflow for the end user where they might not even have to assign people. Everything will -just be done automatically. -As we said, webhooks the instant the quick and actually want one other case where where I where I tend to like to use webhooks and that's when you use forms and you get entries from forms and then you make might want to make a check on. For example, say you're a marketing department or something and you have say, a rule that you will not accept anything unless it's at least 3 or 5 days or whatever time out from when it's supposed to be delivered. Yeah, Monday. Can't check that itself, but we've make it's actually really easy and say yeah, you requested this to be done tomorrow. Yeah. I'm going to send you an email and say no, that's not going to be done. It can be done. Like Monday. Uh, so you can add on any kind of logic to it. It's, it's actually really, really cool when you start using it. It really is. But yeah, that's, that's the main functionality that I at least wanted to show you a few examples of what you can do with webhooks as you're probably already realizing the, the sky really is the limit here. You can take something very basic with a webhook, a very basic trigger and you can do a lot of things.