I am trying to parse the names of students from an email. But it is only giving me the first name. Tried to use the "apply to each" function but it's saying we can't use it along with the "initialize variable" function. Request your help here, please.
This is the HTML version of the email. I've erased the unnecessary stuff for easier explanation.
I want those names (Alex, Lisa, Martha) It is not certain, in some emails there could be more or less names. But the HTML first and last words are the same. See I have marked them in purple and green color.
This is the flow. I have mentioned the formula as well:
It's working but giving only the first student's name. After getting the name, I have to put them on an excel table. And for that this is what I am doing:
The excel:
Please lemme know, how to loop it?
Wow! This worked as charm! Thank you so much bro.
Hi @Ab3l ,
I am not in front of my computer but the easiest thing would be to add a condition where current item contains 'Student name:'
Not elegant by any means but should solve your issue.
--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up
Connect on LinkedIn
Thanks a lot for your time, brother. 🙂
It's working. But there is one small issue. We are splitting using a line break here inside the array but in the actual HTML email, it's a single line.
Like this:
But that's not an issue, I split it using split(variables('Names'), 'Student name: ')
Now the problem is that it's creating one extra line. Like when there are 3 student names, there are 4 "apply to each" output result. The first three are the names, and the last part is the broken HTML line. any way to get rid of that line while putting it on excel?
Hi @Ab3l ,
See if this helps.
You can then apply your first() and last() formula to extract individual names within the loop.
--------------------------------------------------------------------------
If I have answered your question, please mark my post as a solution
If you have found my response helpful, please give it a thumbs up
Connect on LinkedIn
Any help brothers @eric-cheng @v-bofeng-msft ?
WarrenBelz
146,524
Most Valuable Professional
RandyHayes
76,287
Super User 2024 Season 1
Pstork1
65,906
Most Valuable Professional