Hello all!
So I'm using Power Automate to extract data from an email and drop it into a table in Excel. It comes in as below (line breaks/spacing included).
--------------------------
This email is genuine
(You can check the exact date the Notification was triggered by accessing xxx)
ID: xxxxx
Name: Bloggs, Joe
Email Address: joe@bloggs.com
Description: yyyyyy
Year: 2021
Mode: Full-time
Assistant: Smith, Tony (tony@smith.com)
To check this persons profile click here: https://randomurlfordisplaypurposes
Important: please don't reply to this email
-----------------------
Now my expressions work ok for some entries and extracts: ID, Description, Year, Mode. However for Name it extracts all of the email into the Name row of the table and for Email Address it returns a blank. When I look at the Output it gives me the following:
----------------------------------
{
"@odata.context": "
"@odata.etag": "",
"ItemInternalId": "400fd202-0d11-4082-b3b0-e9feeeff4105",
"Date & Time": "2021-11-03T11:28:30+00:00",
"ID": "xxxxx \n\n",
"Name": "Bloggs, Joe \n\nEmail Address: joe@bloggs.com \n\n \n\n \n\nDescription: yyyyy \n\nYear: 2021 \n\nMode: Full-time \n\n \n\n \n\nAssistant: Smith, Tony (tony@smith.com) \n\n \n\n \n\nTo check this persons profile click here: https://randomurlfordisplaypurposes \n\n \n\n \n\nImportant: Important: please don't reply to this email \n\n \n\n \n\n \n\n \n\n \n\n "
}
--------------------------------
Im guessing this is a line break issue of some description(?) but my knowledge of expressions is limited! Unfortunately I have no control over the formatting of the incoming emails. The expressions I'm using are below. Any help appreciated.
--------------------------------
first(skip(split(first(split(body('Html_to_text'),'Name')),'ID: '),1))
first(skip(split(first(split(body('Html_to_text'),'Email Address')),'Name: '),1))
first(skip(split(first(split(body('Html_to_text'),'Description')),'Email Address: '),1))
first(skip(split(first(split(body('Html_to_text'),'Year')),'Description: '),1))
--------------------------------
Edited to add: I'm sure it's the formatting/spacing in the incoming emails, as when I remove it and have it as single lines it works just fine.