cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Alastairs
Frequent Visitor

Getting first line of email as a variable

I am setting up a system of logging new tickets for our team.

 

These will be sent in via email.

 

The subject has a unique bit of text at the start for my flow to pick it up and then customer name, date and time all taken from the spreadsheet

 

The first 2 lines of the email are reserved for the following, both taken from the spreadsheet;

Date

Time

I am looking to take the first line which will only be a date in the format dd/mm/yyyy.

I have got as far as converting the body from html to txt but I am stuck with how to select this date.get date help.png

Thanks for advance for your help

3 REPLIES 3
edgonzales
Super User
Super User

@Alastairs 

Hi there.  I wonder if you left it in HTML, if you'd be able to Split() the body on something like <p> and grab the first two elements of the resultant array.

 

Let me know what you think.

-Ed-

 

 

If you liked this reply, please give it a thumbs up! If this reply has answered your question or resolved your challenge, please consider marking it as a Solution. This helps other users find it more easily via search.

Hi @Alastairs 

 

Just to add to @edgonzales suggestion, you can actually split the body of the email on enter keys. You need to initialize a variable of type string and hit an enter and save it. Next, in a compose action, use the expression first(split('mailbody',variables('enter'))) and this should get you the first line of the body of the email. You can check out the hack that I have posted here: https://powerusers.microsoft.com/t5/Power-Automate-Community-Blog/10-MS-Flow-hacks-troubleshoots-wor... 

 

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!

Sorry for the lateness of replying and thank you for looking into it.

 

Hopefully I'll get some free time tomorrow afternoon to dig into this properly.

Helpful resources

Top Solution Authors
Users online (4,429)