Our Automation team uses Microsoft Azure DevOps to track work. I wanted to build a Power Automate flow to monitor the team inbox, look for the words “Bug” or “Change Request” in email subjects, and then create an ADO bug or change request work item. This requires configuring an email trigger for multiple strings, which is a bit tricky. If you’ve never done it before, read on to learn more about Power Automate email triggers.
The Basics
If you don’t know how to configure the email trigger for multiple strings, you might be tempted to create a copy of the flow. Is it really a big deal to have 2 flows doing almost the same thing? Maybe not, but I always prioritize efficiency. First, the basics.
The Subject Filter in the When a new email arrives trigger only looks for a single string. It monitors the inbox and asks the question – does the subject contain this exact string? It must contain the whole exact string but not just the string.
For example, if I configured the Subject Filter with the string “Change Request” and send emails with the following subjects, these would be the results.
“Change Request” – flow is triggered
“Change” – flow is not triggered
“Change Request from Julie Sebby” – flow is triggered
“Change Something Request” – flow is not triggered
To configure the trigger to work with more than one string, go to Settings.
Triggers for Multiple Strings
Next, from within Settings, go to the Trigger Conditions section. Notice there is an Add button below the text box. Click Add at least once. At this point, we have two options.
Option 1
Search for all words, ignore order or separators
Now, using the syntax shown below, you can search for the words “Change” and “Request” separately. With this configuration, an email with the subject “Change Something Request” would not fail because PA looks for the words independently.
What if I applied similar logic for my desired use case? I want to trigger the flow when it finds the words “Bug or Change Request”. If I add another line to add in the string “Bug”, this won’t work. This configuration requires the subject to contain all 3 words. So, we need another option.
Option 2
Search for one of the words
If I want the solution to look for the strings “Bug” or “Change Request”, I would use the following expression shown in Note Pad for ease of viewing.
This is what it looks like in Power Automate. Unfortunately, editing expressions in Power Automate is still terrible. I do most of my expression editing in NotePad or NotePad++.
This trigger condition creates a cloud flow that triggers if the subject contains “Bug” or “Change Request”.
THE END!
In summary, to configure Power Automate email triggers, head to the trigger settings and add an expression in the trigger conditions. While you learning new things about triggers, check out this post from SP Guides on trigger conditions. I found it helpful.
Pingback: How To Grab the File Extension of an Email Attachment » The Analytics Corner
Pingback: How to Prevent Email Triggers from Firing in Power Automate » The Analytics Corner
Pingback: How To Grab Data from PDFs with Power Automate AI Builder » The Analytics Corner
Pingback: Where Do You Write Expressions in Power Automate? » The Analytics Corner