The system sends an email in the following format.
I want to take out this line by line and process it.
Records are determined by the order of date and time, error code, ID, and message.
This is one pack of data.
*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*- 2019/06/11 18:57:30 System_error_5_occurred 525866,AABBCCDDEEFFGGHH 2019/07/19 21:49:13 System_error_5_occurred 535896,OOKKOOOONJJJOOOO 2019/08/25 13:38:34 System_error_5_occurred 596322,PPKKOKKKKKKMNJJK 2020/01/01 13:30:27 System_error_5_occurred 574147,OOKKAAAAAAAAAAAA *-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-*-
However, the error code is followed by a new line.
Also, this text may be 1 line or 10 lines.In other words, it is variable.
First of all, I do not know the deletion of the line feed is in trouble.
Next, I do not know how to analyze one row at a time and repeatedly acquire data.
(Can Microsoft Flow be used as a regular expression?)
Please help me out. Thank you.
Regex is currenlty not supported directly as a flow action. However, there is a premium connector and a paid service that has this action and is supported in Flow. More details here:
You can raise an idea to include the Regex feature here and you can share your comments, upvote the idea too:
Now coming to the email parsing, I see that the email is pretty structured and using some string manipulations, the data can be extracted. To start with, you can first split the body of the email over the enter key and get the lines of the email in an array and then perform further string operations on that.
Please see a screenshot to split the body of the email at every new line here:
Here, I am taking the body of the email, a string variable with an empty line (initialise a variable as a string and in the value part just hit an enter) and initialiseing an array variable and here i am splittign the body over the enter variable. If you are using the when an email arrives trigger, you can use the body of the trigger and split over the enter variable to get each line as an element in an array and further analyse it.
Hope this Helps!
If this reply has answered your question or solved your issue, please mark this question as answered. Answered questions helps users in the future who may have the same issue or question quickly find a resolution via search. If you liked my response, please consider giving it a thumbs up. THANKS!
Thank you for teaching me a lot.
Regular expressions can only be used for paid services.
For the time being, I would like to make as much as possible with the free service.
Sorry...Though I taught you so much, I can not understand well.
Especially about the part of "Split function".
Is the usage as shown in the image wrong?
For example, such processing is assumed.
(1) "2019/06/11 18:57:30 System_error_5_occurred 525866, AABB CCD EEF FGGHH " Take out the line and go to the next process.
(2) When (1) is over, "2019/07/19 21:49:13 System_error_5_occurred Take out 535896, OOKKOOOONJJJOOOO "to the next processing.
(3) Repeat as long as there is a line.
I'm sorry to be so inquisitive.
Hi @soooofunny ,
Do you want to extract content from email body?
Is the email body always in the same format?
If so, please check the following thread for a reference:
we could get content from email body using WDL functions, you could know more about WDL functions at here:
Hi. @v-yamao-msft .
Yes. That's right. I want to extract from the body of the mail.
It is a mail of the same format except the number of logs is different.
I checked the hyperlink destination that taught me.
Check out the announcement of Power Platform content at Microsoft Ignite!
Join us for an in-depth look at the new Power Automate features and capabilities at the free Microsoft Business Applications Launch Event.
Features releasing from October 2020 through March 2021