
I am trying to build a flow to automate adding data from an email to excel. The email format is as follows:
EXTERNAL EMAIL– Use caution with any links or file attachments.
Exercise caution: This email originated from an external source. Please do not click links or open attachments unless you trust the sender and know the content is safe.
Study - 1234-567
(Information-Import)
Error Message: The record contains a component (serial) number for protocol <1234-567> already used in an order.
File Material Number: 88888888
File Pack Type: 0001
File Plant: 1234
File Storage Location: 1234
File Shipping Point: 1234
File Inventory Batch: XZ12345
File Expiry Date: 2024-12-31
File Country: NA
File Do Not Ship: 2024-11-08
File Serial Number: 3395104
File Barcode: 175080597
File Sequence: 3395104
Study - 1234-567
(Information–Import)
Error Message: The record contains a component (serial) number for protocol <1234-567> already used in an order.
File Material Number: 567890
File Pack Type: 0001
File Plant: 5678
File Storage Location: 5678
File Shipping Point: 5678
File Inventory Batch: XZ12345
File Expiry Date: 2024-12-31
File Country: NA
File Do Not Ship: 2024-11-08
File Serial Number: 3395105
File Barcode: 1099254324
File Sequence: 3395105
Every email contains multiple records like this with the same error message. I am trying to read the file serial number, barcode, sequence etc for each record and add it into a row in excel. I tried implementing the following flow but can't seem to extract just the numbers I want-
I used compose to convert the entire body of email to string and compose1 to split the content by "Error Message: "
Please Help 😞 !!
Hi @thawani ,
Please check this test:
Email Body:
Flow Preview:
Flow Configuration:
skip(split(outputs('Html_to_text')?['body'],'already used in an order.'),1)
trim(split(split(items('Apply_to_each'),'File Material Number:')[1],'File Pack Type:')[0])
trim(split(split(items('Apply_to_each'),'File Pack Type:')[1],'File Plant:')[0])
trim(split(split(items('Apply_to_each'),'File Plant:')[1],'File Storage Location:')[0])
Excel Table:
Best Regards,
Sunshine Gu