Is there a way to extract an email id in flow (power automate) from approval comment output. I'm using approval connector to get an approval on a document but in the comment section the user or approver will put a email id with comments that i need to be extracted.
For eg:
Approver Comment (Input): Ok its approved, I want this to be forwarded to abc.xyz@xxxxx.com
Output: abc.xyz@xxxxx.com
Is it possible to get extracted, @xxxxx.com would be fixed substring, but prefix may vary depending on the user names.
Thanks for all the support.
Solved! Go to Solution.
Thanks for you response @Pstork1 , really appreciate it
I think in this case only your 1st assumption would be right but I won't be able to stop user to put multiple '@' in the comments in any ways. The process that you suggested, seems doable, but need for contexts and logics on your 2nd and 3rd step.
I have found its work around, and its working fine for the current testing's, below is my current work solution.
Approver comment, for eg: Ok its approved, I want this to be forwarded to abc.xyz@xxxxx.com
1) Use 'Split' function on Approver Comment with space separator (' ')
Output: ['Ok', 'its', 'approved,', 'I', 'want', 'this', 'to', 'be', 'forwarded', 'to', 'abc.xyz@xxxxx.com']
2) Use 'Apply on Each' with condition to check if current item contains '@xxxxx.com'
Output: true for 'abc.xyz@xxxxx.com'
3) Email id (replaced any extra space)
Output: abc.xyz@xxxxx.com
I think 🤔 it works for now, but surely there will be challenges come in near future.
But if you could share how to do 2nd and 3rd step would be much better.
Thanks again
In Power Apps this is easier because there is a REGEX function. But that's not available in flow. But If you can assume there is only one email in the comments and also that the character '@' is not used other than as part of an email. Then the high level process is this
1) Split() the comment on the '@' character
2) Split() the first entry in the resulting array on a space. The Last() entry in the resulting array is the first half of the email address.
3) Split() the second entry in the original '@' split array on a space. The First() entry in the resulting array is the email domain of the email address.
4) Concatenate the results from #3 and #4 around a '@' and you have the email.
Thanks for you response @Pstork1 , really appreciate it
I think in this case only your 1st assumption would be right but I won't be able to stop user to put multiple '@' in the comments in any ways. The process that you suggested, seems doable, but need for contexts and logics on your 2nd and 3rd step.
I have found its work around, and its working fine for the current testing's, below is my current work solution.
Approver comment, for eg: Ok its approved, I want this to be forwarded to abc.xyz@xxxxx.com
1) Use 'Split' function on Approver Comment with space separator (' ')
Output: ['Ok', 'its', 'approved,', 'I', 'want', 'this', 'to', 'be', 'forwarded', 'to', 'abc.xyz@xxxxx.com']
2) Use 'Apply on Each' with condition to check if current item contains '@xxxxx.com'
Output: true for 'abc.xyz@xxxxx.com'
3) Email id (replaced any extra space)
Output: abc.xyz@xxxxx.com
I think 🤔 it works for now, but surely there will be challenges come in near future.
But if you could share how to do 2nd and 3rd step would be much better.
Thanks again
Yours should work better if you already know what the domain will be.
Here's the formulas for mine
#Split the approval comment
split(ApprovalComment,'@')
#Get the username portion of the email
last(split(first(outputs('Compose')),' '))
#Get the domain portion of the email
first(split(last(outputs('Compose')),' '))
Yeah I know the domain. Thanks for the logics.
The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.
Learn to digitize and optimize business processes and connect all your applications to share data in real time.
User | Count |
---|---|
29 | |
28 | |
24 | |
17 | |
10 |
User | Count |
---|---|
66 | |
57 | |
29 | |
27 | |
25 |