Skip to main content
Power Automate
    • Connectors
    • Templates
    • Take a guided tour
    • Digital process automation
    • Robotic process automation
    • Business process automation
    • Process advisor
    • AI Builder
  • Pricing
  • Partners
    • Blog
    • Documentation
    • Roadmap
    • Self-paced learning
    • Webinar
    • Business process and workflow automation topics
    • Overview
    • Issues
    • Give feedback
    • Overview
    • Forums
    • Galleries
    • Submit ideas
    • User groups
    • Register
    • ·
    • Sign in
    • ·
    • Help
    Go To
    • Microsoft Power Automate Community
    • Welcome to the Community!
    • News & Announcements
    • Get Help with Power Automate
    • General Power Automate Discussion
    • Using Connectors
    • Building Flows
    • Using Flows
    • Power Automate Desktop
    • Process Advisor
    • AI Builder
    • Power Automate Mobile App
    • Translation Quality Feedback
    • Connector Development
    • Power Platform Integration - Better Together!
    • Power Platform Integrations
    • Power Platform and Dynamics 365 Integrations
    • Galleries
    • Community Connections & How-To Videos
    • Webinars and Video Gallery
    • Power Automate Cookbook
    • Events
    • 2021 MSBizAppsSummit Gallery
    • 2020 MSBizAppsSummit Gallery
    • 2019 MSBizAppsSummit Gallery
    • Community Engagement
    • Community AMA
    • Community Blog
    • Power Automate Community Blog
    • Community Support
    • Community Accounts & Registration
    • Using the Community
    • Community Feedback
    cancel
    Turn on suggestions
    Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
    Showing results for 
    Search instead for 
    Did you mean: 
    • Microsoft Power Automate Community
    • Galleries
    • Power Automate Cookbook
    • Re: Extract and parse data from an email

    Re: Extract and parse data from an email

    08-26-2020 00:40 AM

    Django
    MVP
    2648 Views
    LinkedIn LinkedIn Facebook Facebook Twitter Twitter
    Django
    Django
    MVP
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    Extract and parse data from an email

    ‎05-19-2020 11:27 PM

    Title: Data extraction and parsing from an email

     

    Description: This Flow triggers on an email received to check its body on a dynamic number of keys to find its corresponding value. The trick is in an Apply to each loop based on an array you can manage from within the flow. The flow will find the keys and values you want to extract and parse.

     

    Detailed Instructions: It’s as easy as importing the zipped flow attached, add your connection for Outlook Office 365 and it will trigger on your own inbox emails. I recommend additional filters (like a specific unique phrase in the subject or only a specific mailbox folder) so the flow will only trigger on emails that it should trigger on. Keep in mind that the flow expects a specific key to find and you can change the key in the array step of the flow. You can even change the key-value separator as explained in the video.

     

    Questions: Please feel free to ask anything right here as a reply in this post.

     

     

     

    watch?v=e_8hQibvbYQ

    Preview file
    61 KB
    FlowTest-EmailgetData_20200520061714.zip
    Labels:
    • Labels:
    • Automated Flows
    Message 1 of 48
    66,363 Views
    18 Kudos
    Reply
    • All forum topics
    • Previous Topic
    • Next Topic
    • « Previous
      • 1
      • 2
      • 3
      • 4
      • 5
    • Next »
    s_dupuy
    s_dupuy
    Regular Visitor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎08-18-2020 11:22 AM

    --

    Message 11 of 48
    2,683 Views
    0 Kudos
    Reply
    mstjohnsomc
    mstjohnsomc
    Frequent Visitor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎08-18-2020 06:37 PM

    When I try to Import your pkg zip - I get the following error"

    "Import flow created outside of a solution into this environment. Flows created in a solution can be imported under Solutions. "

     

    Thoughts?

     

    Message 12 of 48
    2,677 Views
    0 Kudos
    Reply
    mxlgbr
    mxlgbr
    Regular Visitor
    In response to Django
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎08-23-2020 08:33 AM

    Will try that. Thank you for the update @Django.

    Message 13 of 48
    2,666 Views
    0 Kudos
    Reply
    Django
    Django
    MVP
    In response to mstjohnsomc
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎08-26-2020 12:40 AM

    Hi @mstjohnsomc, based on only your text it seems you are trying to import the Flow into a solution directly?

    Check https://flow.microsoft.com/en-us/blog/import-export-bap-packages/ for how to import Flows and what limitations apply.

    Message 14 of 48
    2,648 Views
    0 Kudos
    Reply
    iko_chen
    iko_chen Advocate I
    Advocate I
    In response to Django
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎09-09-2020 11:23 PM

    Hi Django

    is it possible to extract the follow content of the email?

    Notification

    FLOC

    FLOC Descr.

    Short text

    Long description

    Work order

    2200025222

    RCS-C-000

    RECEIVING,RAW MATERIALS, MIXING, OTHER

    热熔胶房,罐区桥架内线缆检查

    * 08.09.2020 01:53:54热熔胶房,罐区桥架内线缆检查

    310083157

    2400027317

    RCS-C-000

    RECEIVING,RAW MATERIALS, MIXING, OTHER

    08:00-16:00 早班电气巡检

     

    330003723

    • dd
    Message 15 of 48
    2,597 Views
    0 Kudos
    Reply
    Django
    Django
    MVP
    In response to iko_chen
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎09-10-2020 11:53 AM

    Hi @iko_chen,

    Extracting the data using my technique would not be very useful because my technique always tries to match a key with a value for every key you define. Looking at your data you have a table like structure with the key in the header of the table and a variable number of values in the cells of the table... there may be some possibilities because if your table is send in HTML it will have a consistent structure using table row <tr> and table cell <td> tags and when data is consistent, we can extract it 🤓

     

    My advise would be to post your question in the Power Automate forum, post that link back again here and if your problem is not solved before I can have a look somewhere next week --> I will definitely try to come up with a possible solution in that post!

    Message 16 of 48
    2,591 Views
    1 Kudo
    Reply
    iko_chen
    iko_chen Advocate I
    Advocate I
    In response to Django
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎09-10-2020 03:57 PM

    Hi @Django 

    thank you very much.

    Message 17 of 48
    2,590 Views
    1 Kudo
    Reply
    DVela227
    DVela227
    Frequent Visitor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎10-02-2020 09:17 AM

    Hi @Django!

     

    Thank you so much for your solution. I am trying to recreate it using your example and upload to extract data from Microsoft Bookings events since there is no flow connector yet. The data I am extracting from the email is the custom fields from Bookings. Unfortunately the structure of this data doesn't seem to be in a format where I can use an array. Any ideas on how I can extract the answers after "Answer-" for each custom question? 

     

    Sample Data in Email: 

     

    Custom Fields
    ----------------------
    Question 1- Merchant ID
    Answer- 123456
    Question 2- Contact Name for Installation
    Answer- Peterson
    Question 3- Contact Phone Number for Installation
    Answer- 800-123-4567
    Question 4- Contact Email Address for Installation
    Answer- testingtester@test.test
    Question 5- Manager Responsible
    Answer- Firstname Lastname
    Question 6- Model Number
    Answer- Peripheral
    Question 7- Special Notes
    Answer- helloWorld

     

    Thank you in advance!

    Dave

    Message 18 of 48
    2,494 Views
    0 Kudos
    Reply
    Django
    Django
    MVP
    In response to DVela227
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎10-05-2020 08:30 AM

    Hi @DVela227,

    It should be doable but requires a lot of substring / string logic which can be quite some work.

     

    You can use the split() expression to split your string on every "Question"-part into multiple strings and then you can extract every Answer of every Question. 

     

    Check out this post: https://powerusers.microsoft.com/t5/Building-Flows/extract-the-content-from-table-in-email-to-sharep... where we do the same based on the <td> part of HTML-tables. Hopefully you can use parts of my Flow Logic that I shared there 👍.

     

    I must warn you though: this will be some more advanced flow stuff 🤓

    Message 19 of 48
    2,460 Views
    0 Kudos
    Reply
    Birchenall
    Birchenall
    Regular Visitor
    • Mark as New
    • Bookmark
    • Subscribe
    • Mute
    • Subscribe to RSS Feed
    • Permalink
    • Print
    • Report Inappropriate Content

    ‎10-09-2020 01:19 AM

    I'm having an issue when I try to use the template, but then turn the 'When a new email arrives' into 'When a new email arrives in a shared mailbox'. It changes the first Compose-SenderEmail into an Apply to each with the Compose inside, and you can't change this.

     

    Then when you run the test and it gets to the Apply to each KeyToFind and has the following error:

     

    Action 'Compose_-_FullStringTextResultArray' failed

    Unable to process template language expressions in action 'Compose_-_FullStringTextResultArray' inputs at line '1' and column '2883': 'The template language function 'lastIndexOf' expects its first parameter to be of type string. The provided value is of type 'Null'. Please see https://aka.ms/logicexpressions#lastindexof for usage details.'.

     

    When I tried it as a normal email address it worked fine.

     

    Do you have any suggestions for a solution?

    Preview file
    67 KB
    Message 20 of 48
    2,442 Views
    0 Kudos
    Reply
    • « Previous
      • 1
      • 2
      • 3
      • 4
      • 5
    • Next »

    Power Platform

    • Overview
    • Power BI
    • Power Apps
    • Power Pages
    • Power Automate
    • Power Virtual Agents

    • Sign up free
    • Sign in

    Browse

    • Templates
    • Connectors
    • Partners

    Downloads

    • Mobile
    • Gateway

    Learn

    • Documentation
    • Learn
    • Support
    • Community
    • Give feedback
    • Blog
    • Pricing

    • © 2023 Microsoft
    • Contact us
    • Trademarks
    • Privacy & cookies
    • Manage cookies
    • Terms of use
    • Terms & conditions
    California Consumer Privacy Act (CCPA) Opt-Out Icon Your California Privacy Choices