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

E-Mail Text Parse Returning Unexpected Results

I have created a flow that is triggered by an incoming e-mail that meets a set of criteria.  Part of my flow is to create a response e-mail that contains some of the text in the original e-mail.  To do this, I convert the HTML to text, and then I attempt to split the text into one line per row.  When I try to create my output strings, I am not returning the info I would like to return.  Below is a section on my flow.

 

  • Html to Text is performed on the Body of the incoming e-mail
  • New Line is a Compose that simply creates a new line, so the output in the subsequent step will go to a new line
  • Spit Text splits the text into individual lines:  split(outputs('Html_to_text')?['body'], outputs('New_Line'))
  • Filter Out Blank Lines simply removes lines with no text: length(trim(item())) where the result is > 0.

 

DataFun_0-1680307525153.png

 

 

Here is an example of a section of text from the incoming e-mail:

Event Details

Name:  HRA 1:1

Begin:  03. Apr 2023 (Monday)

End:  03. Apr 2023 (Monday)

 

The data after converting html to text and removing the blank lines looks like the following (the url path is removed for this example):

 

Line 11:  "Event Details Name: HRA 1:1",

Line 12:  "[https://<url path>] Begin: 03. Apr",

Line 13:  "2023 (Monday) End: 03. Apr 2023 (Monday)",

 

When I convert the HTML to text, I would expect this info to be on their own lines, however, that is not the case.  In spite of this, I would expect first(split(body('Filter_Out_Blank_Lines')[11], 'Name:  ')) to capture the HRA 1:1 after Name:  .  My expression returns:

 

[https://<url path>] Begin: 03. Apr

 

Why is my data not splitting like I would expect it to? In the example above I would expect “Event Details” to be on one line and “Name:  HRA 1:1” to be on the next.

When I try to capture the information after “Name:  “, why is it returning “[https://<url path>] Begin: 03. Apr” instead of “HRA 1:1”?  My line number reference is correct as I tested the expression with 10 & 12 to confirm.

 

This same issue happens with other text I search for.  It appears to me the issue is with how the text appears after converting HTML to text.

13 REPLIES 13

Hi @DataFun 

 

Could you change the expression highlighted below 

Nived_Nambiar_0-1680334095952.png

 

with this : 

split(outputs('Html_to_text')?['body'], decodeUriComponent('%0A'))

 

Hope it helps 🙂

VictorIvanidze
Community Champion
Community Champion

Don't use "HTML to Text" action. Parse the HTML itself.

________________________________________________________

Welcome to my web site.

I got the same result using the code you suggested.

VictorIvanidze
Community Champion
Community Champion

Could you show HTML text before conversion?

________________________________________________________

Welcome to my web site.

Hi @DataFun 

 

Before converting the email body to html trying this split expression using <br> as delimiter

 

split({Email_body}, '<br>')

 

Specify dynamic content of email body replacing {Email_body} 

 

Hope it helps 🙂

Here is the html from the incoming e-mail:

 

<p>&nbsp;</p>

<p>[cid:logo]</p>

<p>[cid:mail-banner-signup]</p>

<p><br />
THANK YOU FOR YOUR REGISTRATION</p>

<p>Dear Registrant,</p>

<p>You successfully registered for the event HRA 1:1<br />
[https://******]. If you have<br />
any further event related questions feel free to contact the event owner.</p>

<p>You have registered for an 1:1 consultation with an HR Advisor and will receive<br />
a calendar invitation with the meeting details. We look forward to connecting<br />
with you!</p>

<p>Event Details</p>

<p>Name:</p>

<p>HRA 1:1 [https://*****]</p>

<p>Begin:</p>

<p>05. Apr 2023 (Wednesday)</p>

<p>End:</p>

<p>05. Apr 2023 (Wednesday)</p>

<p>The following details have been entered:</p>

<p>Q: Please confirm you are a people manager</p>

<p>A: Yes</p>

<p>Q: What topic would you like to discuss during the meeting?</p>

<p>A: General Consultation (local policies, change management, culture &amp; inclusion,<br />
data and org planning, compensation topics)</p>

<p>Q: What specific questions do you have?</p>

<p>A: - Answer #3</p>

<p>&nbsp;</p>

<p>Best Regards,<br />
Your Support Team</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

<p>&nbsp;</p>

DataFun
Frequent Visitor

I think I understand why I am not getting the info as I expect.  The incoming e-mail uses a table template, so what appears to be on the same line in the e-mail gets output to two separate lines when run through html to text.  I assume html-to-text is putting the first column on one line and the second column on the next line for each row in the table.  I copied the text of the message and pasted with no formatting into an e-mail and sent it through my flow and it parsed as I would have expected.  

 

The e-mail template has some lines with a single column and others with two columns.  Is there a way I can join the columns coming out of the e-mail table template into a single line?

Hi @DataFun 

 

Does it appears in email with table format, looking at html, i think it is coming as paragraph wise 

As mentioned above, some lines appear to be a single column, however, the highlighted info below is the info I am trying to retrieve and it appears to be in separate columns.  I can select the first column for all three rows without the second column be selected.  This indicates to me that this information is formatted as two separate columns.  If I hit Reply and select this section of the e-mail, the Table Design tab appears on the Ribbon.  

DataFun_0-1680786786292.png

Here's how the e-mail looks if I add borders.  Ideally, I would like to be able to just pull the Event Details and the responses to the questions.  If that doesn't work, I would be happy if I could remove the first two rows that have images in them so I am left without the lines:

 

[cid:co-logo]

[cid:mail-banner-signup]

DataFun_1-1680787249610.png

 

Hi @DataFun 

 

So to confirm finally what you need is the values highlighted in below image 

Nived_Nambiar_0-1680794174056.png

 

 

and the html structure of that is like below

 

 

 

 

 

 

[cid:logo]

[cid:mail-banner-signup]


THANK YOU FOR YOUR REGISTRATION

Dear Registrant,

You successfully registered for the event HRA 1:1
[https://******]. If you have
any further event related questions feel free to contact the event owner.

You have registered for an 1:1 consultation with an HR Advisor and will receive
a calendar invitation with the meeting details. We look forward to connecting
with you!

Event Details

Name:

HRA 1:1 [https://*****]

Begin:

05. Apr 2023 (Wednesday)

End:

05. Apr 2023 (Wednesday)

The following details have been entered:

Q: Please confirm you are a people manager

A: Yes

Q: What topic would you like to discuss during the meeting?

A: General Consultation (local policies, change management, culture & inclusion,
data and org planning, compensation topics)

Q: What specific questions do you have?

A: - Answer #3

 

Best Regards,
Your Support Team

 

 

Right ?

 

 

 

 

Correct.  I wouldn't need the text Name:, Begin:, or End:, but it is fine if I do get it.  Thank you for your help on this.  I am new to Power Automate and I have been trying my best to resolve this on my own.  

One more question, would the questions and field names would be always fixed?

Yes, the questions are fixed.  Only the answers change.  From time to time we will change the questions, but I can cross that bridge later, if needed.  As for the Event Details, the Name, Begin, and End are fixed and the response details vary from message to message.

Helpful resources

Announcements

Community will be READ ONLY July 16th, 5p PDT -July 22nd

Dear Community Members,   We'd like to let you know of an upcoming change to the community platform: starting July 16th, the platform will transition to a READ ONLY mode until July 22nd.   During this period, members will not be able to Kudo, Comment, or Reply to any posts.   On July 22nd, please be on the lookout for a message sent to the email address registered on your community profile. This email is crucial as it will contain your unique code and link to register for the new platform encompassing all of the communities.   What to Expect in the New Community: A more unified experience where all products, including Power Apps, Power Automate, Copilot Studio, and Power Pages, will be accessible from one community.Community Blogs that you can syndicate and link to for automatic updates. We appreciate your understanding and cooperation during this transition. Stay tuned for the exciting new features and a seamless community experience ahead!

Summer of Solutions | Week 4 Results | Winners will be posted on July 24th

We are excited to announce the Summer of Solutions Challenge!    This challenge is kicking off on Monday, June 17th and will run for (4) weeks.  The challenge is open to all Power Platform (Power Apps, Power Automate, Copilot Studio & Power Pages) community members. We invite you to participate in a quest to provide solutions to as many questions as you can. Answers can be provided in all the communities.    Entry Period: This Challenge will consist of four weekly Entry Periods as follows (each an “Entry Period”)   - 12:00 a.m. PT on June 17, 2024 – 11:59 p.m. PT on June 23, 2024 - 12:00 a.m. PT on June 24, 2024 – 11:59 p.m. PT on June 30, 2024 - 12:00 a.m. PT on July 1, 2024 – 11:59 p.m. PT on July 7, 2024 - 12:00 a.m. PT on July 8, 2024 – 11:59 p.m. PT on July 14, 2024   Entries will be eligible for the Entry Period in which they are received and will not carryover to subsequent weekly entry periods.  You must enter into each weekly Entry Period separately.   How to Enter: We invite you to participate in a quest to provide "Accepted Solutions" to as many questions as you can. Answers can be provided in all the communities. Users must provide a solution which can be an “Accepted Solution” in the Forums in all of the communities and there are no limits to the number of “Accepted Solutions” that a member can provide for entries in this challenge, but each entry must be substantially unique and different.    Winner Selection and Prizes: At the end of each week, we will list the top ten (10) Community users which will consist of: 5 Community Members & 5 Super Users and they will advance to the final drawing. We will post each week in the News & Announcements the top 10 Solution providers.  At the end of the challenge, we will add all of the top 10 weekly names and enter them into a random drawing.  Then we will randomly select ten (10) winners (5 Community Members & 5 Super Users) from among all eligible entrants received across all weekly Entry Periods to receive the prize listed below. If a winner declines, we will draw again at random for the next winner.  A user will only be able to win once overall. If they are drawn multiple times, another user will be drawn at random.  Individuals will be contacted before the announcement with the opportunity to claim or deny the prize.  Once all of the winners have been notified, we will post in the News & Announcements of each community with the list of winners.   Each winner will receive one (1) Pass to the Power Platform Conference in Las Vegas, Sep. 18-20, 2024 ($1800 value). NOTE: Prize is for conference attendance only and any other costs such as airfare, lodging, transportation, and food are the sole responsibility of the winner. Tickets are not transferable to any other party or to next year’s event.   ** PLEASE SEE THE ATTACHED RULES for this CHALLENGE**   Week 1 Results: Congratulations to the Week 1 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge.   Community MembersNumber SolutionsSuper UsersNumber Solutions Deenuji 9 @NathanAlvares24  17 @Anil_g  7 @ManishSolanki  13 @eetuRobo  5 @David_MA  10 @VishnuReddy1997  5 @SpongYe  9JhonatanOB19932 (tie) @Nived_Nambiar  8 @maltie  2 (tie)   @PA-Noob  2 (tie)   @LukeMcG  2 (tie)   @tgut03  2 (tie)       Week 2 Results: Congratulations to the Week 2 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 2: Community MembersSolutionsSuper UsersSolutionsPower Automate  @Deenuji  12@ManishSolanki 19 @Anil_g  10 @NathanAlvares24  17 @VishnuReddy1997  6 @Expiscornovus  10 @Tjan  5 @Nived_Nambiar  10 @eetuRobo  3 @SudeepGhatakNZ 8     Week 3 Results: Congratulations to the Week 3 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 3:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji32ManishSolanki55VishnuReddy199724NathanAlvares2444Anil_g22SudeepGhatakNZ40eetuRobo18Nived_Nambiar28Tjan8David_MA22   Week 4 Results: Congratulations to the Week 4 qualifiers, you are being entered in the random drawing that will take place at the end of the challenge. Week 4:Community MembersSolutionsSuper UsersSolutionsPower Automate Deenuji11FLMike31Sayan11ManishSolanki16VishnuReddy199710creativeopinion14Akshansh-Sharma3SudeepGhatakNZ7claudiovc2CFernandes5 misc2Nived_Nambiar5 Usernametwice232rzaneti5 eetuRobo2   Anil_g2   SharonS2  

Check Out | 2024 Release Wave 2 Plans for Microsoft Dynamics 365 and Microsoft Power Platform

On July 16, 2024, we published the 2024 release wave 2 plans for Microsoft Dynamics 365 and Microsoft Power Platform. These plans are a compilation of the new capabilities planned to be released between October 2024 to March 2025. This release introduces a wealth of new features designed to enhance customer understanding and improve overall user experience, showcasing our dedication to driving digital transformation for our customers and partners.    The upcoming wave is centered around utilizing advanced AI and Microsoft Copilot technologies to enhance user productivity and streamline operations across diverse business applications. These enhancements include intelligent automation, AI-powered insights, and immersive user experiences that are designed to break down barriers between data, insights, and individuals. Watch a summary of the release highlights.    Discover the latest features that empower organizations to operate more efficiently and adaptively. From AI-driven sales insights and customer service enhancements to predictive analytics in supply chain management and autonomous financial processes, the new capabilities enable businesses to proactively address challenges and capitalize on opportunities.    

Updates to Transitions in the Power Platform Communities

We're embarking on a journey to enhance your experience by transitioning to a new community platform. Our team has been diligently working to create a fresh community site, leveraging the very Dynamics 365 and Power Platform tools our community advocates for.  We started this journey with transitioning Copilot Studio forums and blogs in June. The move marks the beginning of a new chapter, and we're eager for you to be a part of it. The rest of the Power Platform product sites will be moving over this summer.   Stay tuned for more updates as we get closer to the launch. We can't wait to welcome you to our new community space, designed with you in mind. Let's connect, learn, and grow together.   Here's to new beginnings and endless possibilities!   If you have any questions, observations or concerns throughout this process please go to https://aka.ms/PPCommSupport.   To stay up to date on the latest details of this migration and other important Community updates subscribe to our News and Announcements forums: Copilot Studio, Power Apps, Power Automate, Power Pages

Users online (698)