cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
th_son
Level: Powered On

Use text from an email in push notification message

Hi,

 

I woudl like to setup a flow that will send me a push notification when I receive a specific email. I want to use the contents of the email to compose the message for the push notification.

 

Some details about the email:

  • Email will always come from same address.
  • The email comes in as HTML

What I have do so far:

  • The flow will trigger when I receive this specific email
  • I convert the email to plain text.

Email after conversion

Alert

Customer

Company Name

Title

Some very important Alert

Severity

Informational

Category

UnwantedSoftware
Detection Time

The date and Time

Some Portal Portal Link

Generic HTML Link



This message from Microsoft is an important part of a program, service, or
product that you or your company purchased or participates in.

Microsoft respects your privacy. Please read ourPrivacy Statement
Generic HTML Link

Microsoft Corporation
One Microsoft Way
Redmond, WA 98052 USA 

Generic HTML Link

I want to take "Severity", "Informational", "Category", and "UnwantedSoftware" and format it like this:

Severity: Informational
Category: UnwantedSoftware

The "Information" and "UnwantedSoftware" part may not always read that way, it could change based on what triggers the email.

 

Any ideas on how I might do that?

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support Team
Community Support Team

Re: Use text from an email in push notification message

Hi @th_son,

 

You could add a Compose under the "Html to text" action, and then choose the "the plain text content" dynamic content of the "Html to text" action in the Compose input field,

And then refer to screenshot below to create the flow:

Capture.PNG

 

The expression in Informational action the as below:

last(split(first(split(outputs('Compose'),'Category')),'Severity'))

The expression in UnwantedSoftware action the as below:

last(split(first(split(outputs('Compose'),'Detection Time')),'Category'))

 

The expression in the Compose 4 action the as below:

concat('Severity:',outputs('Informational'),'Category:',outputs('UnwantedSoftware'))

 

The flow would run successfully as below:

Capture.PNG

 

Best regards,

Alice

2 REPLIES 2
Community Support Team
Community Support Team

Re: Use text from an email in push notification message

Hi @th_son,

 

You could add a Compose under the "Html to text" action, and then choose the "the plain text content" dynamic content of the "Html to text" action in the Compose input field,

And then refer to screenshot below to create the flow:

Capture.PNG

 

The expression in Informational action the as below:

last(split(first(split(outputs('Compose'),'Category')),'Severity'))

The expression in UnwantedSoftware action the as below:

last(split(first(split(outputs('Compose'),'Detection Time')),'Category'))

 

The expression in the Compose 4 action the as below:

concat('Severity:',outputs('Informational'),'Category:',outputs('UnwantedSoftware'))

 

The flow would run successfully as below:

Capture.PNG

 

Best regards,

Alice

th_son
Level: Powered On

Re: Use text from an email in push notification message

Hi Alice,

 

So I tested this out and it works great. Thank you so much for taking the time to respond.

I am just curious though, how does it actually work?

 

I am especially confused by the following:

last(split(first(split(outputs('Compose'),'Category')),'Severity'))

I was trying to follow it to understand how it is actually accomplishing its task, but I haven't had any luck.

 

That may be a loaded question so I don't blame you if you don't respond.

 

On a side note, when the push notification comes in I get the test all on one line? Is it possible to separate "Severity" and "Category" onto their own lines?

Helpful resources

Announcements
firstImage

Microsoft Flow Online Conference

Join us for a FULL day of FREE Microsoft Flow Sessions from some of the best minds in the industry!

firstImage

Watch Sessions On Demand!

Continue your learning in our online communities.

Power Platform 2019 Release Wave 2 Plan

Power Platform 2019 Release Wave 2 Plan

Features releasing from October 2019 through March 2020

thirdimage

Flow Community User Group Member Badge

Fill out a quick form to claim your user group badge now!

thirdImage

New Flow Community Board!

Check out the new Microsoft Flow Community Blog Topic Suggestion board!

fifthimage

Microsoft Learn

Learn how to build the business apps that you need

sixthImage

Power Platform World Tour

Find out where you can attend!

seventhimage

Webinars & Video Gallery

Watch & learn from the Flow Community Video Gallery!

Top Kudoed Authors
Users Online
Currently online: 62 members 3,908 guests
Please welcome our newest community members: