web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / PowerAutomate extract ...
Power Automate
Unanswered

PowerAutomate extract specific table row

(0) ShareShare
ReportReport
Posted on by 12

Im looking to have an automated email alert we receive cut down into just 1-2 lines.

 

The initial email comes through to us and has some HTML formatting with a table etc and I have converted this to plain text.
I then am trying to have a couple of lines from this table display in Teams as an alert. I can get the whole email to show, or none of the email to show... never just the 1-2 rows of the table I need. I have tried using the below expression however this is showing no data in the alert within teams. The email always has just 2 columns and the first column is always the same wording however the 2nd column is variable. For example:

 

Company A

12
Company B333

Company C

44444
Company D98765
Company E

456789

 

The output I want to have is Row 3 and Row 4 as an alert in teams

Company C

44444
Company D98765

 

As mentioned i can get the whole email (in both HTML and plain text) to display but i cant seem to get the exact data i want. Any help would be greatly appreciated. 

 

Thanks and regards

Categories:
I have the same question (0)
  • Luke11 Profile Picture
    12 on at

    concat(trim(slice(body('Html_to_text'), nthIndexOf(body('Html_to_text'), ' ', 183), add(nthIndexOf(body('Html_to_text'), ' ', 187), 1))), slice(body('Html_to_text'), nthIndexOf(body('Html_to_text'), ' ', 187), nthIndexOf(body('Html_to_text'), ' ', 188)))

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Luke11 

     

    Could you post a sample data in plain text after converting HTML to txt? Think you could use split() expression, separator as carriage return then specify the index 2 and 3 to retrieve row 3 and 4.

     

    Thanks

  • Luke11 Profile Picture
    12 on at

    the below is how it has come out following a HTML to Plain text conversion. In the full HTML table i want the 10th & 11th row (the one with 9512 and 52) these rows always have the same column A but the number in column B always changes so thats the important bit. As a side note i got this far by following your YT vids i think 🙂

    Company PLANNED

    WORKS

    Company PLANNED WORKS(CLOSURE)_Unknown_Multiple Sites_Multiple MSAN_Multiple

    Dear colleague,

    Company confirms the change window for the areas listed has now concluded. Company is not expecting any further service disruption.

    We recommend that you check with the end users to confirm that the impacted services have restored successfully.

    If any customers continue to experience problems they should first reset their device. If they continue to experience problems, they should report it to Company as a new fault.

    Company regrets any inconvenience this may have caused you.

    IMPACTED SITES

    Location location location location location

    1. OF CUSTOMERS IMPACTED

    21

    SUBSCRIBERS AFFECTED

    CompanyName

    Subscriber Count

    Company

    10

    Company

    2

    Company

    1

    Company

    1

    Company

    1

    Company

    1

    Company

    46

    Company

    3

    Company

    9512

    Company

    52

    Company

    2

    Company

    2

    Company

    1

    Company

    3

    Company

    17

    Company

    1

    Company

    1

    Company

    4

    Company

    7

    Company

    1

    Company

    1

    SERVICE IMPACT

    ALL

    DETAILED DESCRIPTION OF WORK

    Do thigs and stuff

    DATE & CHANGE WINDOW

    15/02/2023 23:59:00 to 16/02/2023 06:00:00

    DURATION OF OUTAGE

    0 Days 6 Hours 1 Mins

    CHANGE OR FAULT REFERENCE NUMBER

    Change number

    This is a system-generated mail. Please do not reply.

    Company Logo

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Luke11 

     

    Company PLANNED

    WORKS

    Company PLANNED WORKS(CLOSURE)_Unknown_Multiple Sites_Multiple MSAN_Multiple

    Dear colleague,

     

    What are those lines before the Dear colleague. Is that from email body? A bit confused about your message. Also highlight which lines you are after.

     

    This is what you need to do.

     

    After converting the plain text add a compose and press enter key (Carriage return).

     

    Add another compose action step after, use expression split() here define the first parameter output from html to text and second parameter compose action step (carriage return).

     

    Next step add another compose to define the output from the split() expression to get the index.

     

     

  • Luke11 Profile Picture
    12 on at

    All the gumph above the table contents is just a bit of email with some info... all of which can be ignored for this alert i need. I have gotten to the below but im a little stuck on what you mentioned below:

    and second parameter compose action step (carriage return).
    Next step add another compose to define the output from the split() expression to get the index.

    Have i done it correct below? 

    Luke11_5-1681817034522.png

     

    I have marked in RED the lines i want to be displayed

     

    SUBSCRIBERS AFFECTED

    CompanyName

    Subscriber Count

    Company

    10

    Company

    2

    Company

    1

    Company

    1

    Company

    1

    Company

    1

    Company

    46

    Company

    3

    Company

    9512

    Company

    52

    Company

    2

    Company

    2

    Company

    1

    Company

    3

    Company

    17

    Company

    1

    Company

    1

    Company

    4

    Company

    7

    Company

    1

    Company

    1

     

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Hi @Luke11 

     

    Here it is

     

    image.png

    image.png

     

    Above expression are as follows:

     

    split(outputs('Compose'),outputs('Enter_Key'))
    outputs('Compose_2')?[38]
    outputs('Compose_2')?[40]
    outputs('Compose_2')?[42]
    outputs('Compose_2')?[44]
     
    Here is my test result:
    image.png
    image.png
  • Luke11 Profile Picture
    12 on at

    Its not my day it seems... Im getting an error on compose 3 (and i assume would also error on the rest?) 

    Luke11_0-1681825797779.png

    Unable to process template language expressions in action 'Compose_3' inputs at line '0' and column '0': 'The template language expression 'outputs('Compose_2')?[38]' cannot be evaluated because property '38' cannot be selected. Property selection is not supported on values of type 'String'. Please see https://aka.ms/logicexpressions for usage details.'.

     

    Luke11_1-1681825840799.png

     

  • abm abm Profile Picture
    32,865 Most Valuable Professional on at

    Expand your run history steps and check the previous steps. See what returned.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 501 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 323 Moderator

#3
abm abm Profile Picture

abm abm 237 Most Valuable Professional

Last 30 days Overall leaderboard