Add a loop to workflow that scans hash via MS Teams

Hi all,

I need some help about something that is probably really simple but I just cant figure it out.

Now I am using an already existing workflow template called “Enrich File Hash with Microsoft Teams”. It scans given hashes via MS Teams and gives you a summary based on the report.

Now what I want to accomplish is this:

I want to be able to write multiple hashes within the same command and get a summary for each individual hash. Ex: !enrich-hash hash1 hash2

I added a “Process Hashes” loop step here, which loops over the message send in Teams:

Here, I repeat over the message send in MS Teams:

These are the steps I put into my loop:

But then I get these errors:

I dont get what else I am suppose to do or add.

I followed this guide here: Loop Step Basics

I would appreciate any tips or help. I am still learning btw, I have been working with InsightConnect for the past 2 weeks as part of my internship.

The step you copied and put into your loop is called Scan Hash -1. All your other steps and reports are looking for the variables from the step called Scan Hash. If you deleted the Scan Hash step outside your loop you can now rename the step in your loop to only be Scan Hash, no -1.

Additionally your loop input is using the words array from the Teams message. This isn’t an issue, just be aware that the first word in the words array is the trigger word. So if this workflow fires by typing a Teams message “Scan-Asset hash-1 hash-2 hash-3” The words array would send 4 words through.

At the start of your loop you would want some logic to have it disregard the trigger word. A possibility would be a decision step with two paths.

Your logic would be your loop.item variable = Scan-Asset

You would want it to disregard that Scan-Asset and move to the next item.

1 Like

Additionally, the Teams Trigger gives you a Hashes object with different hash types(MD5/SHA1/SHA256) by automatically parsing hash values from trigger words. While you can’t directly feed this object into a loop, you can use the Type Converter plugin to Combine the different hash arrays into one array and then pass that output into your loop. This would keep you from having to create additional logic in the loop to skip the first word.