Showing results for 
Search instead for 
Did you mean: 
Frequent Visitor

Extract Data From Email and Create Array Object



I have a e-commerce email that notifies me of any new orders, like so:




SKU 123456

QTY  5





I would like to process the order information so as to create an array object named "Order" with the text in bold as keys and the plain text as the values. I can,  in theory, place a delimeter between the two, (i.e SKU | 123456) to help with the split function, but have yet to find a way creat an array object and input the key value pairs as described above.

Resolver II
Resolver II

Hi @Mobutu1650 , 

I assume you're using the "when an email comes in" trigger.


You won't be able to do keypairs in an array as they're meant to be 1D. A riskier method would be creating 5 arrays and returning the pairings by [position], but I wouldn't recommend that.


There's an other variable type "object" which you could use.  Are you familiar with JSON? If the emails are always exactly the same, you could split by spaces and count which objects would be the value in the key-value pairs. Create 5 variables, then you would have an apply to each loop on the split(emailbody,' ') value and a Switch statement (like if, but with many else branches) to get your 5 values and then use a Compose step to build the JSON like this:


"SKU": "[value from variable]",

"QTY": "[value from variable]" 



Then you can set your object variable to the outputs of this Compose step

Frequent Visitor

Thanks, but unfortunately, the products in question have a massive amount of options/configurations that make parsing the email content and iterating through all possible if/else conditions somewhat tricky. Wondering if it would be just easier to split the bolded and plain text and throw it in column excel column or list...


Helpful resources

Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

Carousel_PP_768x460_Wave2 (1).png

2022 Release Wave 2 Plan

Power Platform release plan for the 2022 release wave 2 describes all new features releasing from October 2022 through March 2023.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (3,640)