6 Workflow Type Search Shared by Jesse Beaird, Pathway Church 5 months ago 10.0 General Beginner If you are new to the team or have taken over for someone else or you just don't remember which category you put that last workflow in you may be interested in this workflow type search recipe. I have found this helpful since I am not the originator of most of our org's workflows and there may be multiple categories a workflow might fit. We are basically using an WorkflowType entity command and building a table. We are using Datatables.net to allow us to make the table searchable. This recipe is borrowing components of our DataView search created by Jesse McColm.Step 1. You will need a new page created. For us we created a full width child page of the Workflow Configuration page. In the 'Advanced Settings' for the new page in the in 'Header Content' field we have the following for DataTables.<link rel="stylesheet" type="text/css" href="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.min.css"/><script type="text/javascript" src="https://cdn.datatables.net/v/dt/dt-1.10.18/datatables.min.js"></script><style> .padding-bottom-md { padding-bottom: 1em; }</style>Step 2. Add an HTML block to the new page with the following. Ensure 'Rock Entity' is enabled in the block settings. ( note: the page number may be different for your environment in the first <td> tag. This should be the page number for your workflow configuration page. )<div class="row"> <div class="col-sm-6"> <h2><strong>Search for Workflows</strong></h2> <div class="alert alert-warning"> Use the search text box to search for a Workflow by name or description. </div> </div></div><div class="row"> <div class="col-md-2 col-md-offset-4 padding-md-all"> <div class="text-center"> <input class="form-control" id="searchbox" type="text" placeholder="Search" aria-label="Search"> </div> </div></div><table id="test" class="table table-striped table-bordered"> <thead> <tr> <th>Workflow</th> <th>Description</th> <th>Category</th> <th>Logging Level</th> <th>Created</th> <th>Is Active?</th> </tr> </thead> <tbody> {% workflowtype where:'Id > 0' %} {% for workflowtype in workflowtypeItems %} <tr> <td><a href="/page/136?workflowTypeId={{ workflowtype.Id }}">{{ workflowtype.Name }}</a></td> <td>{{ workflowtype.Description }}</td> <td>{{ workflowtype.Category.Name }}</td> <td>{{ workflowtype.LoggingLevel }}</td> <td>{{ workflowtype.CreatedDateTime }}</td> <td>{{ workflowtype.IsActive }}</td> </tr> {% endfor %} {% endworkflowtype %} </tbody></table><script>$(document).ready( function () { var dataTable = $('#test').DataTable( { "dom": 'lrtip' } ); $("#searchbox").on("keyup search input paste cut", function() { dataTable.search(this.value).draw(); });} );</script>Steps 1 and 2 will be enough to get a workflow type search page up and running. We can go a little further and add some buttons to launch the page when needed. On the workflow configuration page for the sidebar add a HTML block above the Workflow Tree block and include the following. ( Note: check those page numbers. First one should be for the newly created search page and the second one is for the workflow configuration page. Update those colors if needed. )<div class="well"> <h4><strong>Tools:</strong></h4> <center> <a class="btn btn-default" href="/page/1677"><span style="color:#ee7725;"><b><i class="fas fa-search"></i> Workflow Search</b></span></a> <a class="btn btn-default" href="/page/136?workflowTypeId=0"><span style="color:#ee7725;"><b><i class="fas fa-plus-square"></i> New Workflow</b></span></a> </center></div>
Alfredo Marrero Reply 3 months ago Hey Jesse, Thanks for this, it's awesome!It seems to limit the entries to 1000. Is there any way to increase this?
Jesse Beaird 2 months ago Yes, 1000 item limit is default with Rock on entity command. You would have to call out a limit higher than your expected total items. ex. {% workflowtype where:'Id > 0' limit:'2000' %}
Myles Svendsen Reply 5 months ago Jesse, this was a game-changer for us. Thanks for sharing. In addition to Workflows, we've adapted it to our CMS Pages as well. So helpful to be able to search by any of the returned columns. Thanks!!!