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

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / Extract a part from a ...
Power Automate
Unanswered

Extract a part from a HTML string and store in a variable

(1) ShareShare
ReportReport
Posted on by 2
Hi, 
 
I want to extract a body and emails from the below string in power automate :
 
 
<div class="ExternalClassFCD14869688A40F2A3F9CD309841D521"><p>here is the comment <a href="mailto:; test1@xxx.com">surname, name</a>&nbsp;<a href="mailto:;test2@xxx.com"> surname, name</a></div>
 
I want to extract 'here is the comment' part as Body . 
And I want to extract those email ids and atore them in a variable which I defined already in the flow. (Here's only 2 mails are present, but it could be multiple) . 
 
I'm getting error. (Maybe cause of the &nbsp part present in the string) 
Categories:
I have the same question (0)
  • Suggested answer
    Michael E. Gernaey Profile Picture
    53,335 Super User 2025 Season 2 on at
    Hi,
     
    Please share your code, if you say you are getting an error, but do not share your flow, your code, the flow, the flow run, then its really just a waste of time for us to read.
     
    There are ways to help if we fully understand for instance
     
    to get the here is the comment
     
    you would use
     
    trim(split(split(mystring, '<p>')[1], '<a href')[0])
     
    So what this would do is split based on <p> which would give you 2 parts [0] and [1] where [1] now starts with her is the comment which is why after the first split I put the [1]
     
    Then I split by the <a href, which now creates 2 parts [0] which has your string you want and [1] which doesn't
     
    I used trim becasue there is a space after comment
     
    But the same type of parsing for your other stuff
     
    If this helps please mark so.
     
    just follow the same mindset of parsing
     
     
     
     
     
     
     
     
     
     
     

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

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 522 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 364 Moderator

#3
abm abm Profile Picture

abm abm 243 Most Valuable Professional

Last 30 days Overall leaderboard