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

When a new email arrives that contains a "specific" word on the body

Hi All,

 

I have a flow wherein all emails I received from a specific sender will be added into a excel file (add a row into a table step).

I created "initialize variable" step for the power automate to get the email body which contains (eg. name, incident number, status, root cause) and split it and add it into different columns in my excel. 

 

The problem is there are certain emails that doesn't contains "root cause" and power automate just generate the entire body for the root cause column. I'm trying to formulate an expression wherein if the email body doesn't contains "root cause" it will  return blank on my excel file. Can you please verify if its possible.

 

Here are my original formulas:

 

Initialize variable 1:

last(split(variables('Emailbody'), 'Rootcause '))

 

Initialize variable 2:

first(split(variables('Rootcause1'), ':'))
 
Please let me know if my query is possible. Thank you.
 
Regards,
6 REPLIES 6
Super User II
Super User II

If you could provide an expanded screenshot of your Flow and steps, your Flow run history, and of any detailed error messages you're receiving we could likely better assist you. Also, for the best results, you may want to review How to write a good forum post.

👨🏻‍💻 If this reply answers your question or solves your issue, please ACCEPT AS SOLUTION ☑️. If you find this reply helpful, please consider giving it a LIKE 👍.

Community Support
Community Support

Hi @heydamianards ,

 

Please share a screenshot of the email and the text of the email body so we could better understand your issue and provide a workaround for you.

 

Best regards,
Alice       
 
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi

 

 

 

 

 

 

Hi @v-alzhan-msft 

 

Basically I received 2 type of alerts emails which are active & resolved. For active it doesn't have the root cause while the resolved has it. Now, because of that all email body was generated on the excel file root cause column. Please see below.

Capture2.PNG

 

For that instance wherein there's no root cause I want it to be like this:

Capture1.PNG

 

Thank you very much.

Hi @heydamianards ,

 

Please share a screenshot of the received email.

 

Best regards,
Alice       
 
Community Support Team _ Alice Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Hi  

 

Please see below:

 

Active Email without root cause:

Email2.png

 

Resolved Email with root cause:

Email1.png

Helpful resources

Announcements
Community Conference

Power Platform Community Conference

Check out the on demand sessions that are available now!

MPA Community Blog

Power Automate Community Blog

Check out the community blog page where you can find valuable learning material from community and product team members!

Top Solution Authors
Top Kudoed Authors
Users online (12,942)