Hi,
I am using the When a new email arrives in a shared mailbox action and want to filter out emails with the specific keyword in the subject.
Instead of using the condition I tried Subject filter field but whatever I put there the action will work for any email subject.
If you found it working for you, please share how to use it.
If you found it not working - question to the MS Flow team - please remove it or make it work and document it with an example so we know how it works.
/Mike
Really struggling to get to this to work and I've tried a lot of variations now, have also tried adding the expression in the subject filter but also setting nothing in subject filer and the expression in the settings but none work
when I only add on work to filter on without the expression it works, so I know the problem is not the flow
I want to move the email if the subject line contain one of two words
Any help is much appreciated!
I tried the same and it didn't work out until I used a new step with the condition "Subject contains [String]".
In order to archieve it without conditions I would try something like "substring" rather than "contain" function, as it gets items contained in arrays and so, not strings.
Regards,
Hello, I have a question with regards to subject filter. May i know if the notifications can be triggered only once even if the same mail is forwarded back and forth. As of now i keep getting notifications multiple times for the same email.
link broken
Inspired by @Gaolai I have tried out complex conditions. It took me a while to understand the syntax.
I have explained how to build complex trigger conditions in my article "Trigger conditions - filling the information gap". I hope some find it useful.
Finally got the RegEx to work yesterday. Basically picked the wrong Plumsail SP element in the Flow. So after a new email arrives I now have RegEx Test (Plumsail SP) and the RegEx is:
^(HR\d{5,6}-\d{1,2})
I want to send an Email to Applicants requesting they resend the Email with the Application number at the start of the Subject Field. And then delete the Email.
Applicants who correctly have the application number at the start of the Subject get a confirmation Email for receipt and then the email is moved to a folder for processing.
The definite actions can be problematic when testing on your personal Outlook Inbox. I decided to have a spreadsheet in One Drive for RegExYes and separately for RegExNo, to prove the Flow is working, before implementing on a Shared Email. The Spreadsheets on the Shared Inbox will be a good way to test before doing the non passive actions that are not reversible. Body Preview in the Spreadsheet Rows is difficult particularly if the Email is long so, I may remove this, not sure if you can force Row height in the Excel Spreadsheets.
I have worked out more RegEx for possible Applicant verification as well as the Application Number:
Postcode outside London:
[A-Z]\d{1,2}\s+\d{1}[A-Z][A-Z]
Date of Birth UK:
\d{2}/\d{2}/\d{4}
National Insurance Number UK:
[A-Z][A-Z]\d{6}[A-Z]
I have Conditions before the RegEx Test to take staff emails away from the Reg Ex by saying "From" "ends with" "Email domain after @"
RegEx Test (Plumsail SP) at start of E-mail Subject
Hi @Gaolai ,
I tried using this but it didn't work, my trigger is email with specific words as subject filter, i want to look for pricing or cost in the subject line. I tried
@or(contains(triggerBody()?['Subject'], 'Price'),contains(triggerBody()?['Subject'], 'Pricing'),contains(triggerBody()?['Subject'], 'Cost'))
into the subject filter, but it didnt give results. Am i missing out on something?
Thanks.
PlumsailSP Connector - you will need to create an account on the Plumsail website and create a API Type: Actions – Basic.
You enter the API Key in the section of your Flow when inserting a PlumsailSP Connector, and then input the pattern which I think for you is:
(\d{3}-[A-Z][A-Z][A-Z]-\d{3})
And you enter where in the emails you want to find the Regular Expression.
It was suggested to me that I could try an Azure Function but I have looked into it and have no clue how to do this...
Hi Michal @Michal ,
I have managed to get Regular Expression Match to work in my Power Automate Flow. I registered with Plumsail and created an API key (Key Type: Actions - Basic). You have to use PlumsailSP Connector not the Documents Connector via Plumsail when selecting in the Flow when editing it.
My department uses a customer number in this format:
HR12345-1 or HR12345-12
or
HR123456-1 or HR123456-12
Basically the main number started at about 75000, but now most customers have a 6 digit number. Also customers have a version number normally under 10, but some times go past 9, so there are some with 2 digits after the dash.
So the "Pattern" is:
^(HR\d{5,6}?-\d{1,2}?)
And for the Text Field I entered "Subject" in the Outlook 365 Connector (not sure what you call each element).
Basically the "^" means the RegEx starts at the start of the Field
In my following Condition I used "Match0" For the Yes side of the Condition to move the E-mail to a folder to be processed. Just a bit baffled because the No side does not seem to work for incorrect HR numbers (not entered), I need to address this. As I want to send a bounce back reply requesting the customer input the account number at the start of the Subject when resending. Before the email is deleted from the inbox.
Basically we struggle with so many emails from customers internal colleagues and third sector organisations, and no one is forced to put the customer number at the start of the subject. This would be very simple for us to sort the subjects in number order and see all the emails for each customer before processing.
I intend to further develop this with a RegEx in the main body of the emails as well. Basically the UK National Insurance Number is a critical bit of ID: AB123456C I think the RegEx pattern is: ([A-Z][A-Z]\d{6}[A-Z])
Also date of birth (in the UK) is useful dd/mm/yyyy I think the RegEx pattern is: (\d{2}/\d{2}/\d{4})
We could make it more prescriptive for the bounce back of incorrectly submitted emails.
this is very helpful:
regexhero.net/library/
regexhero.net/reference/
Plumsail respond in under 24 hours so very helpful.
Cheers James
Thanks, will have a look and post my solution if I can do it.
WarrenBelz
146,635
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,997
Most Valuable Professional