Rock U - Workflows - Custom Grid Actions v13

Transcribed Video Content

Anywhere in Rock that you see a grid, you can add custom actions to this grid. And what that'll do is it'll take all the items listed in a grid, and these could be people, or group members, or any type of entity, and it'll perform some sort of action on them, maybe launching a workflow. So, in this video, we're gonna take a look at looking at some data view results of people, and we're gonna add a custom action to those results to be able to launch a workflow for each person contained in the data view. So, the first thing that we're gonna do is navigate over to tools and data views. And under foundational views, we'll look at pending people. And, again, this data view returns people, and there's only three people listed here, which will work great for our example. Again, throughout this video, we'll be referencing this grid and the people in it, but don't forget that custom actions can be added to any grid containing any type of entity. Alright. So what we're gonna do is we're gonna open the the block properties for the data view results block, And we're gonna go over to the custom grid options tab, where the panel for custom actions can be expanded. To start, we're gonna click the add actions button. And when you do that, you'll see that, we're being asked for three pieces of information, the the root, the icon CSS class, and the help task help text. So the route will indicate where the person is taken when they click the icon that we're gonna be creating in the next step here. So in this example, we'll put in a route, and this will take us to page two six one six, which leads to the workflow launch block in our instance. So what this is gonna do is our custom action that we're building here will have the effect of launching a workflow for each person in the list of people returned by the data view. And again, we're using the workflow launch block for this example, but the route can take you anywhere in Rock. So the key is just ensuring that the target page or block that you're going to knows what type of entity it's working with, because the grid's contents are passed as an entity set. You'll also notice that we provided a workflow type ID in the route. This will force only this workflow to be run, and it's gonna hide the workflow picker from that page. So, our action is only going to be able to be used for one particular workflow, and you'll see what that looks in a minute. We also want to note that even though you can't see it here, you can pass workflow attribute values into the workflow by including those parameters in the query string. So we could just as easily add, , , and campus ID equals one, or something that, is possible to do from your route here. Next up, we have the icon. The icon that you pick here is gonna appear along with the other icons that you're used to seeing at the top and the bottom of any grid in Rock. So, we'll use the font awesome icon of Fafa Adjust for this example, just kind of at random. And in a minute, you'll see what that looks when we're done. But in the meantime, we'll come down here to the help text, and this text will appear when a person hovers their mouse over the icon in the grid. So when they come to that adjust icon and hover their mouse over it, they're gonna see the help text, which so we'll put a a helpful, message in. And, again, you'll see what this looks in a second after we save the configuration. But we can say we'll say launch photo requests, because that's what work workflow type ID 16 in our instances. It's the photo request workflow. So we'll just put that in and click save. And now, with this configuration saved, we can go back to this data view and see that the new icon has been added to the top and to the bottom of the grid. And just you can see, hovering my mouse over those icons pops up that help test, help text launch photo requests. And if I go ahead and click on the icon, we're taken straight to the workflow launch page. And you'll note here that we can only launch the specified workflow. That's because we passed in the workflow type ID in our route, so that's what's locking it in to the photo request workflow. And just keep in mind that a separate workflow is gonna be launched for each of the people listed here. So in this example, we're gonna have three workflows launched because there were three people in our grid. This workflow launch block that we're using for this example, is covered in detail in our launch workflow from grid video. Be sure to check that out as well to learn more about the configuration options that you have here. So, again, try not to lock yourself into thinking of this feature as being used only for people and launching work flows. You can use it for a grid that contains any type of entity, and the route that you provide can do different things. And so get creative, and think about how you might be able to use this to streamline some of your processes. For more information, check out our blasting off with workflows guide posted to the Rock community website, and thanks for watching.