What this scenario does: Retrieves tickets in Zendesk, compares each ticket’s subject and description to predefined keywords (apps in this specific case) and if there’s a match, the keywords are added to Airtable.
Level Of Difficulty: Intermediate
Implementation Time: 15 mins
If you want to create specialized content for your customers or users like help guides, courses or even marketing campaigns, you know that gaining insight on your customers needs and customizing the content according to those needs is absolutely valuable.
Well that’s exactly what this scenario does by matching keywords (apps) that your customers/users mention in tickets to predefined keywords for further analysis and customized content creation. Of course, you can adapt the keywords to fit your specific needs. Let’s begin.
Configuring the scenario
The scenario consists of the following modules:
- Zendesk > Watch tickets
- Zendesk > Get a user
- Tools > Set variable
- Iterator
- 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 the 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 Subject and Description in order to match them to the predetermined keywords added to the subsequent module.
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 Subject element outputted by the Watch tickets module within the brackets followed by the plus operator. Add the space element found under the Text and binary tab, add another plus operator and map the Description element. After the semicolon, add another space element:
Since you want to verify if the ticket’s subject and description contains certain 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 subject and 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 Subject and Description elements outputted by the Zendesk > Watch tickets module to the corresponding fields in the table:
In most cases, apps will be mentioned multiple times in the 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. So the lower function is used to unify all to lowercase:
Lastly, map the Text element outputted by the Text Aggregator within the brackets:
In the Name, Email fields, map the corresponding elements outputted by the Zendesk > Get a user module, and the map the other data from the Watch tickets module:
All set! Now let’s test the scenario.
Scenario execution
Here, 10 tickets were retrieved from Zendesk, the apps mentioned in the ticket’s subjects/descriptions matched 3 keywords and were added to the table:
That’s all folks! Hope you found this tutorial useful!
Happy automating!