web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

News and Announcements icon
Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Saving email as variab...
Power Automate
Suggested Answer

Saving email as variable then exporting to excel

(1) ShareShare
ReportReport
Posted on by 2
Hi everyone,
 
I know there are a lot of posts about copying from an email to an excel but I think this is a little different. 
 
The flow should look like: I get an email once a week and I have to save the content as a variable then within the body I have to find specific rows I want to save as a variable. Within the email there are 10 "users/groups" that I am looking at and within every user I want to find the same content... Name, if they are an existing customer, date, age, etc. Then I want to capture those variables and paste them into an excel, each row should be an individual user.
 
The part I'm struggling with is when I use crop text it only captures the first occurrence not the 10 that I need. This is what I have so far...
 
Any help would be greatly appreciated!
  • Nived_Nambiar Profile Picture
    18,138 Super User 2026 Season 1 on at
    Hi 
     
    Could you show how email body looks like ?
     
    The part I'm struggling with is when I use crop text it only captures the first occurrence not the 10 that I need. This is what I have so far...
     
    I think - first loop may have 1 items to be iterated - just a thought 
     
     

    Thanks & Regards,
    Nived N

    Stay connected:
    LinkedIn | YouTube | Blogs

    Was this answer helpful?
    If yes, please mark it as the solution by selecting the checkbox in the discussion thread.
    Your feedback motivates me to keep contributing. Thank you!

  • Suggested answer
    eetuRobo Profile Picture
    4,607 Super User 2026 Season 2 on at
    Your For each loop doesn't store the value anywhere. So it will over write the value every loop. Create either a list or a datatable where you store the value.

    You are using IndividualCusomers list in all the actions inside the loop when you should be using the loop item "Customer"


     
    Also your IndividualCustomers is a List and seems like your logic is built like it would be a datatable.
    The step 13 Set varialbe will always set CustomerName variable to be the first item in the IndividualCustomers -list. You should use the Customer loop item.


     
    You can remove the Index from the For each loop. Now you are just adding an item with value 1 to the IndividualCustomers list in the For each loop. For each takes each list or data table item one by one so it does not need index. So your last loops Customer will have value "1" and the Crop text will return empty string.

    To fix modify your flow to look like this:

     

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Kudos to our 2025 Community Spotlight Honorees

Expanding mentorship, skilling, and AI innovation

Leaderboard > Power Automate

#1
Mohsin Ali Profile Picture

Mohsin Ali 426

#2
11manish Profile Picture

11manish 308 Super User 2026 Season 2

#3
M Bilal Khan Profile Picture

M Bilal Khan 159

Last 30 days Overall leaderboard