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 / Copy specific body con...
Power Automate
Unanswered

Copy specific body content of email

(0) ShareShare
ReportReport
Posted on by 26

Hi,

I would like to make a flow that when an email arrive a specific content of the body of the email will be captured. I am not sure if this is possible as I'm only using power automate.

 

The flow I currently have can capture the date and time when an email arrive and insert it on a new row in excel.

 

screenshot2.jpg

 

And here is what I need to capture.

 

screenshot.jpg

 

Data format I need to capture is:

"123456789" <123456789>

 

I manage to copy the content of the email, but it includes all the unnecessary texts.

 

Any thoughts on how I can achieve the above please?

 

Thank you very much in advance.

 

Categories:
  • alaabitar Profile Picture
    1,503 Super User 2024 Season 1 on at

    Hello,

     

    What you could do is to search for the word From and the word Duration and takes what is in between from the body of email.

     

    Best regards,

    Alaa

  • jayzone Profile Picture
    26 on at

    Hi alaabitar,

     

    Thanks you for your response. 

    Can you shed some light please on how I add this to my flow?

     

    Thank you.

  • alaabitar Profile Picture
    1,503 Super User 2024 Season 1 on at

    You can do something like

    alaabitar_0-1641480548544.png

    Where

    FromIndex is indexOf('From',triggerOutputs()?['body/body'])

    ToIndex is indexOf('Duration', triggerOutputs()?['body/body'])

    TextToCopy is substring(triggerOutputs()?['body/body'],variables('FromIndex'),sub(variables('ToIndex'),variables('FromIndex')))

     

    Best regards,

    Alaa

  • jayzone Profile Picture
    26 on at

    Hi alaabitar,

     

    After adding your suggestion, my flow didn't work. It was failing.

     

    I wonder what I'm doing wrong.

  • alaabitar Profile Picture
    1,503 Super User 2024 Season 1 on at

    Can you tell where it is failing ? And what is the error please?

  • jayzone Profile Picture
    26 on at

    Hi,

    I'm not sure where it's failing. It's not giving me the error in the flow checker. But this is what I have:

     

    screenshot.jpg

    Thanks

  • alaabitar Profile Picture
    1,503 Super User 2024 Season 1 on at

    And in the runtime where is the error ?

  • jayzone Profile Picture
    26 on at

    There's nothing in the runtime except the status Failed.

  • alaabitar Profile Picture
    1,503 Super User 2024 Season 1 on at

    If you click on that instance that says fail, it will open the flow and you will be able to see where is the error

  • jayzone Profile Picture
    26 on at

    Hi,

    Thank you for your patience. Appreciate it. Here's the error:

     

    The 'start index' for function 'substring' must be equal to or greater than zero and must be less than '2904' which is the length of the string.

     

    screenshot.jpg

    Thanks

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 377

#2
11manish Profile Picture

11manish 302 Super User 2026 Season 2

#3
Henil Profile Picture

Henil 130

Last 30 days Overall leaderboard