Lesson 7: Display Data with Artifact Templates

In the previous lesson, you learned how to display loop content in artifacts. Now we'll show you how to build more robust artifacts and aggregate data with string templates.

Use an Artifact Template

To format your artifact with the #each template:

  1. Open your Welcome Workflow in the Workflow Builder. If you see a bar in the top center showing Unpublished Changes, select View Changes. Otherwise, simply edit the workflow to continue making your changes.
  2. Open the configuration panel for the “Unsigned Artifact” by clicking on the step icon.
  3. Copy and paste or type the content below into the “Output format” field, below any previous Markdown content.
The nameservers for this domain include:
{{#each [Whois Lookup].[name_servers]}}
- {{this}}
  1. Click the Preview button, then click the Add Artifact button.
  2. Test the workflow with rapid7.com and take a look at the artifact. The “Unsigned Artifact” will now include the full list of Whois nameservers for the domain.
  3. Click on the X in the upper right corner to close the test, then activate the workflow to make sure your changes are saved.

Congratulations! You learned how to modify an artifact with a string template.

InsightConnect offers myriad ways to use and display workflow data. In Lesson 6, you created artifacts within loops to display one array item at a time. In this lesson, we used a string template to display data from the same array in one single artifact.

Step variables can hold varying sizes and types of data, and nested variables allow one variable to hold as much information as the step requires. Arrays are a type of nested variable, and string templates help you modify how this data is shown in an artifact so you can make sure you see the details you need without having to dig through logs or full step output. To learn more about a specific plugin’s variable types, locate the plugin’s documentation in InsightConnect.

The “#each” template used in this lesson allows you to quickly display content from nested variables, and other templates allow you to include, exclude, or otherwise specify which information should be shown. These templates create formatted blocks. Within these blocks, you can determine how to format the content to display. In this lesson, {{this}} referenced a single item within the “Whois Lookup.name servers” array variable, and {{#each}} instructed the artifact to display all of the items one by one. Using {{this}} in the template allowed you to display the full list of nameservers.

Your workflows can use different combinations of the features outlined in these lessons to automatically format, operate on, and display data pertinent to your existing security processes.