

We don't need to do anything complex with this because it's the start of the string we want the index of, not the end. The first parameter of sub() is the place where our relevant text ends - which in this case is the start of the string "Phone Number: ". Thus a lot (the second parameter of sub()) of the expression above is similar to the one before - calculating the number of characters into the source string that our relevant text starts. To do this we use the sub() function to subtract the number we just calculated from the indexOf() the place we want to stop looking. Next we have to calculate the length of the string, for the 3rd parameter of substring(): sub( So by using indexOf() to find the place in the source string where "Email: " exists, then adding that number of characters to it, we get the point we want to start reading the email address. We don't calculate this dynamically it's 7, including the space. Now we don't actually want the string "Email: " in the output of this expression so we now add() a number to the output of indexOf() to get the number of characters into the message body the end of "Email: " occurs. Here we are calculating the indexOf() the string "Email: " it doesn't matter where in the original message body this occurs, indexOf() will find it and return a number. The indexOf() function finds the number of characters into a text string that a string occurs.

So firstly we need to know how many characters into the source text to start. so we can grab the relevant text no matter how long is it. the start index, which is the number of characters into the string to start looking and 3.

The subsstring() function has 3 inputs, 1. Subject field set to output of " Compose 6" action.īest you please share an example about your scenario?

add(indexOf(body('Html_to_text'),'Subject'),9)Īdd a "Compose 5" action, Inputs set to following formula:.substring(body('Html_to_text'),outputs('Compose_2'),sub(outputs('Compose'),outputs('Compose_2')))Īdd a "Compose 4" action, Inputs set to following formula:.Add a "Compose 3" action, Inputs set to following formula:.Add a "Compose" action, Inputs set to following formula:Īdd a "Compose 2" action, Inputs set to following formula:Īdd(indexOf(body('Html_to_text'),'End time'),10).Add a "Html to text" action, Content field set to Body dynamic content of the trigger.Add a "When a new email arrives" trigger.I assume that the details of your incoming email as below and you want to extract the Subject and End time content from Body of the email: I have made a test on my side and please take a try with the following workaround: You please share an example about your scenario?ĭo you want to extract content from body of the email?
