I am trying to make a flow filter emails based on a serial number found in the subject line of an email.
I have the intended recipients located in a SharePoint list with their respective serial numbers. I want to forward the email if the subject contains a serial number(SN) found in the list. If no "owner" can be found for that SN, then I want to send an email to myself that an owner is missing.
I built a flow identical to the one found in this solution: Solved: Check if an email subject matches a SharePoint Lis... - Power Platform Community (microsoft.... It works just fine for the "YES" condition, but I found that for the "NO" condition, because it is looping through the whole "get item" list I get a "no owner found" email for every row in my contact list (which can be a lot of spam).
Each SN is unique, so ideally I want this to only loop once and send a single email for either the forward email, or the notification that there is no owner.
Thanks in advance for any help!
Solved! Go to Solution.
What’s the pattern of the serial number in the Subject line?
I’m thinking the simplest solution would be to parse the number out of the subject line so you can just use the Odata filter on the Get items where ListSN eq SubjectSN
What’s the pattern of the serial number in the Subject line?
I’m thinking the simplest solution would be to parse the number out of the subject line so you can just use the Odata filter on the Get items where ListSN eq SubjectSN
An example subject format would be:
"IR - Asset ID : ###### Model : ###### SN : ######"
Asset IDs, Model #s can very in length... maybe I can parse from the end of the subject string to always get the fixed amount of SN characters? @takolota
@JBloot
Try
trim(
split(Subject, ‘:’)?[3]
)
That should split that up my the colons, then the ?[3] tells it which one you want starting from 0.
You could also use
trim(
last(
split(Subject, ‘:’)
)
)
If it is always the last value.
Then if the list column is a number column, add a int( ) function before the trim.
User | Count |
---|---|
103 | |
36 | |
29 | |
25 | |
16 |
User | Count |
---|---|
136 | |
54 | |
53 | |
36 | |
26 |