What this scenario does: Retrieves tickets in Zendesk, compares the ticket’s descriptions to predefined keywords (apps) and if there’s a match, the apps are added to Airtable.
Level Of Difficulty: Intermediate
Implementation Time: 20 mins
Doing some market research on what your users or customers are asking about the most? How about which apps they need the most content on? Well that’s exactly what this scenario does by retrieving the apps users mention in tickets for further analysis. Of course, you can adapt it to fit your specific needs. So let’s begin.
Configuring the scenario
The scenario consists of the following modules:
- Zendesk > Watch tickets
- Zendesk > Get a user
- Tools > Set variable
- Tools > Text aggregator
- Airtable > Create a record
Here’s the scenario:
The scenario starts with the Zendesk > Watch tickets module. First you need to add a connection to Integromat. In the Watch field, you have the option of selecting Only new tickets or All changes. Select Only new tickets and under Status, select New:
Now you need to retrieve the user’s details which is required for Airtable. In order to do that, add the Zendesk > Get a user module and simply map the Requester ID element outputted by the Watch tickets module to the User ID field:
The next step is to separate each word in the ticket’s description in order to match them to the predetermined keywords added to the subsequent modules.
To do this, add the Tools > Set variable module and give the variable a name. To split the words, select the split function found under the Text and binary tab. Next, map the Description element outputted by the Watch tickets module within the brackets and add the space element also found under the Text and binary tab:
A Router follows splitting the scenario into 2 routes. The top route is for keywords which are actually various apps and the bottom route is specifically for e-commerce apps.
Let’s look at the top route. Since you want to verify if the ticket’s description contains these keywords, you need to add these keywords to the Tools > Set variable module to create an array containing a collection of them.
Under the Function for working with arrays tab, select the add function, then map the emptyarray element and enter the keywords in the brackets:
Next you need to iterate through the ticket description array created by the first Set variable module in order for it to be used in the subsequent filter. Add an Iterator and simply map the variable (Ticket_description in this case) element to the Array field:
Between the Iterator and the Tools > Text Aggregator is a filter:
The purpose of this filter is to verify if the keywords match any of the words in the ticket’s description. Map the variable (accepted_keywords in this case) element outputted by the second Set variable module to the top field, select the Contains (case insensitive) array operator and map the Value element outputted by the Iterator to the bottom field:
If there are multiple apps that match the keywords, each app will be added to a new row in the table. The purpose of the Tools > Text aggregator module is to aggregate these apps so that it can be added to a single row in the table.
Select the Iterator as the Source Module, Other as the Row separator and enter a comma (,) as the Separator. Also tick the Stop processing after an empty aggregation option:
In the advanced settings, simply map the Value element outputted by the Iterator to the Text field:
In the Airtable > Create a record module, select the Base and the Table. Then, map the relevant elements outputted by the Zendesk > Get a user module to the corresponding fields in the table:
In most cases, apps will be mentioned multiple times in a ticket which results in duplicates being added to the table. To avoid this, you need to use several functions.
First add the deduplicate function to the App field:
Next, add the split and the lower function. The lower function is used since in most cases when users type the name of an app multiple times, some may begin with a lowercase and others with uppercase.
Lastly, map the Text element outputted by the Text Aggregator within the brackets:
In the Title and Description fields, map the Subject and Description elements outputted by the Zendesk > Watch tickets module:
Moving on to the bottom route..
The only difference between the top and bottom route is that the Set variable module contains Ecommerce apps (keywords):
The rest of the modules have the same configuration as those on the top route.
Now let’s test the scenario.
Here, 10 tickets were retrieved from Zendesk, the apps mentioned in the ticket’s descriptions matched 2 keywords on the top route and 3 on the bottom route:
The apps were added to the table:
Tada! Hope you found this tutorial useful and will implement it soon.