cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
th_son
New Member

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
Highlighted
Community Support
Community Support

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

View solution in original post

2 REPLIES 2
Highlighted
Community Support
Community Support

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

View solution in original post

th_son
New Member

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

New Ranks and Rank Icons released on April 21!

The time has come: We are finally able to share more details on the brand-new ranks coming to the Power Automate Community!

firstImage

Now Live: Power Virtual Agents Community!

We are excited to announce the launch of Power Virtual Agents Community. Check it out now!

firstImage

New & Improved Power Automate Community Cookbook

We've updated and improved the layout and uploading format of the Power Automate Cookbook!

thirdimage

Power Automate Community User Group Member Badge

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

sixthImage

Community Summit North America

The top training and networking event across the globe for Microsoft Business Applications

Top Solution Authors
Users online (7,472)