cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
BenjaminMartin
Helper I
Helper I

Insert row in Excel from Email

Hi Everyone,

I'm trying to insert dynamic text from new hire emails into an Excel spreadsheet. 

 

Here's the format of the email I'm trying to pull from:

 

Name: John Doe

Start: 1/18

Position: ISS

Please set up email as: john.doe@acmeco.com

 

I can't figure out which expression to use to insert it. I'm using the template for Insert row in Excel (Business) when a new email arrives in a shared mailbox .

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-litu-msft
Community Support
Community Support

Hi @BenjaminMartin,

 

You could following these steps to approach that:

1. I store the email body into a Compose action.

2. Initialize a string variable, store a blank line into it, click "Enter" button once.

3. use split() function separate the email body by using the blank row as a separator;

split(outputs('Compose'),variables('BlankRow'))

4. Use Filter array action to filter out rows contains ":";

5. use split() function again, to extract line 1's name, line 2's Start, etc. Store in their respective variables.

split(body('Filter_array')[0],': ')[1]
split(body('Filter_array')[1],': ')[1]
split(body('Filter_array')[2],': ')[1]
split(body('Filter_array')[3],': ')[1]

Screenshot 2020-12-17 145109.jpg

 

Screenshot 2020-12-17 145142.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-litu-msft
Community Support
Community Support

Hi @BenjaminMartin,

 

You could following these steps to approach that:

1. I store the email body into a Compose action.

2. Initialize a string variable, store a blank line into it, click "Enter" button once.

3. use split() function separate the email body by using the blank row as a separator;

split(outputs('Compose'),variables('BlankRow'))

4. Use Filter array action to filter out rows contains ":";

5. use split() function again, to extract line 1's name, line 2's Start, etc. Store in their respective variables.

split(body('Filter_array')[0],': ')[1]
split(body('Filter_array')[1],': ')[1]
split(body('Filter_array')[2],': ')[1]
split(body('Filter_array')[3],': ')[1]

Screenshot 2020-12-17 145109.jpg

 

Screenshot 2020-12-17 145142.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

Thanks for your help, i'm making progress.

 

What do I put in the filter array step? You put From Outputs, item contains ...., I keep getting errors on that step

 

v-litu-msft
Community Support
Community Support

Hi @BenjaminMartin,

 

On the left side, it is expression "item()", get current item; on the right side, it is a colon ":".

Its function is to filter out rows contains key-value.

Screenshot 2020-12-23 154236.jpg

 

Best Regards,
Community Support Team _ Lin Tu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
MPA_User Group Leader_768x460.jpg

Manage your user group events

Check out the News & Announcements to learn more.

V3_PVA CAmpaign Carousel.png

Community Challenge - Giveaways!

Participate in the Power Virtual Agents Community Challenge

Carousel 2021 Release Wave 2 Plan 768x460.jpg

2021 Release Wave 2 Plan

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

Top Solution Authors
Users online (2,330)