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 / Flow: Find / Isolate V...
Power Automate
Unanswered

Flow: Find / Isolate Value within a String

(0) ShareShare
ReportReport
Posted on by 27

Hello All! 

 

I'm trying to leverage our use of ASANA as a project management tool with our clients through FLOW to send out an e-mail when projects are completed asking for the client to complete a survey / ranking.  Problem is - the information I need to send to an individual is located in a single attribute ("note").  In order to set up the pretty simple flow, I need to isolate the 'email' value provided in this document.  I can't wrap my brain around which direction to lean...

 

Currently the string looks like this:

 

----

 

Project Name:
My really cool project
 
Name:
First: John
Last: Smith
 
Organization Name:
Super Cool Awesome Company
 
Email:
johnsmith@test.com
 
Phone Number:
999-999-9999
 
Completed electronic file is due to you by::
2019-11-15
 
----
 
Basically I just need to capture the value of e-mail from this whole string using an expression.  Possible? Any advice?
 
 

 

Categories:
I have the same question (0)
  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @CodyS I believe that you could do the following:

    1. Use the indexOf expression to find the location of the string Email:
    2. Use the indexOf expression to find the location of the string PhoneNumber:
    3. Use the substringOf expression to grab all text between the two
    4. Use the trim expression on the result

    You may/may not need to use the HTML to text action on your content before your start.

    Let me know if you need an example.

     

     

     

  • CodyS Profile Picture
    27 on at

    Thanks @ScottShearer  - that explanation totally makes sense. Thanks for listing it out.  As it's my first time building an advanced expression in FLOW, I'm having a hard time conceptualizing how I would nest a lot of these expressions - would you suggest working from the bottom up and layering the pieces in?

     

    I tried putting them together that way and wound up with:

    trim(substring(triggerBody()?['notes'],indexOf(triggerBody()?['notes'], 'Email:'),indexOf(triggerBody()?['notes'], 'Phone Number:')))
     
    but it didn't return just the e-mail - it returned a longer string, akin to:
    "Email: jsmith@uvm.edu Phone Number: 9999999999 Completed electronic file is due to you by:: 2019-11-04 "
     
    Close...but my brain just isn't quite there.  Any advice?
  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @CodyS 

    To simply things, you might try using variables or compose actions for each piece and doing it one step at a time.  When you have that working, then put it all together into a single expression and remove the variables.  So, create a variable for indexOf(Start) and another for indexOf(End), etc..  Then, reference those two variables in the substring action.  It is easier to get it working that way when you are first starting with expressions.  One thing to note, the indexOf will give you the position where a string starts - you'll need to do some math and add to that index so that you end up at the end of the string (if that makes sense...).

    If you are having trouble, post what you have and we'll go from there.

     

  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @CodyS 

    UPDATE:  In my screen shot below in the Find Email: String compose action, remove the : after Email in the expression.

    Also, please note that if the text I am searching for appears elsewhere, then the results will not be what is expected.

     

    Please see my example below.  All the expressions that I used can be seen in the action comments.  I started by putting your sample text in a compose action.  After doing this, I think it would be a really bad idea to have this all in one expression - leave it broken out per my example.  Post here if you need more help.

    FindEmail1.jpgFindEmail2.jpgFindEmail3.jpgFindEmail4.jpg

     

     

  • Verified answer
    v-bacao-msft Profile Picture
    on at

     

    Hi @CodyS ,

     

    Please try the following method, using the fixed field name as the split point to extract the email.

    Use the split() function to split the email body with "Email:" and "Phone Number:" and extract the email.

    Expression reference:

    trim(split(split(body('Html_to_text'),'Email:')[1],'Phone Number:')[0])

    Image reference:

    81.PNG

    Hope it helps.

     

    Best Regards, 

  • ScottShearer Profile Picture
    25,270 Most Valuable Professional on at

    @CodyS 

    The solution provided by @v-bacao-msft is obviously a much better solution.  I keep forgetting to use split() …..

     

  • CodyS Profile Picture
    27 on at

    @v-bacao-msft  - That worked perfectly with the slight alteration so that it can worth with the ASANA connection:

     

    trim(split(split(triggerBody()?['notes'],'Email:')[1],'Phone Number:')[0])

     

    Much thanks to both you and @ScottShearer for your help.  EXTREMELY helpful - both in finding the answer and in understanding how these expressions work. 🙂 

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