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 / Extracting data from e...
Power Automate
Unanswered

Extracting data from email to sheets based on either keywords

(0) ShareShare
ReportReport
Posted on by

How do I extract email content based on if either keywords are in the email? Sample email format (Html to text output) below and the text I want extracted is "My PC > Documents > BC > 2025".

First keyword is "My PC". Text pulled starting there and ending before the first "[" after "My PC".

Say the other keyword is "KW2". Email format is the same and the extracted text sample could be "KW2 > Other Docs > Other Folder > 2020".

The code I attached has been returning False every time, even when either keywords are in the email content.


email sample

[ourwebsite/images/logo.123456.321]
- - - - - - - - - - - - - - 

Boss R,
I saved the files in my PC.
My PC > Documents > BC > 2025

[seeee notes jsklajskaljsakl]

Me

 

or(
 if(contains(outputs('Html_to_text'), 'My PC'),
 substring(
 outputs('Html_to_text'),
 indexOf(outputs('Html_to_text'), 'My PC'),
 sub(
 indexOf(outputs('Html_to_text'), '[', indexOf(outputs('Html_to_text'), 'My PC')),
 indexOf(outputs('Html_to_text'), 'My PC')
 )
 ),
 false
 ),
 if(contains(outputs('Html_to_text'), 'KW2'),
 substring(
 outputs('Html_to_text'),
 indexOf(outputs('Html_to_text'), 'KW2'),
 sub(
 indexOf(outputs('Html_to_text'), '[', indexOf(outputs('Html_to_text'), 'KW2')),
 indexOf(outputs('Html_to_text'), 'KW2')
 )
 ),
 false
 )
)

 

 

Categories:

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
11manish Profile Picture

11manish 307 Super User 2026 Season 2

#2
Mohsin Ali Profile Picture

Mohsin Ali 289

#3
Henil Profile Picture

Henil 127

Last 30 days Overall leaderboard