cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
abbyamante
Helper I
Helper I

Expression Function to only extract the specific Keyword from the message body

Hello! 

 

Is there an expression function to remove the rest of the text in the message body and only leave the specific word?

im building a flow that "when the keywords are mentioned (teams) ". what i want to happen is

1. if the Specific keyword is mentioned

2. If the keyword mentioned is "Two"

3. create item in sharepoint list using the specific keyword "value" Two.

 

here is my flow so far:

 

abbyamante_2-1655314091814.png

 

abbyamante_1-1655314055228.png

 

Here is the output from the HTML to Text:

 

Good Morning!

The reports have been uploaded for Group2, thank you!

Below are the homes that were processed:
Altamonte Autumn Lake Crown Ensign Harborview Loretto McCoy McCoy Paramount
Pavillion Pavillion Preferred Care Reliant Sterling Healthcare Transitional Care
Mgmt Transitional Care Mgmt

The following had issues with passwords:
N/A

Please review.

Group Two

 

I need to get just the word "Two" from the body of the message

 

please help! thank you in advance!

 

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
v-yujincui-msft
Community Support
Community Support

Hi @abbyamante ,

 

Maybe you could consider judging what specific keywords are contained in the message body and output the corresponding value.

 

I have made a simple test for your reference.

 

Here is my flow.

body('Get_message_details')?['body/plainTextContent']
 
if(contains(outputs('Compose'),'Two'),'Two',if(contains(outputs('Compose'),'Three'),'Three',if(contains(outputs('Compose'),'Four'),'Four',if(contains(outputs('Compose'),'Five'),'Five',if(contains(outputs('Compose'),'Six'),'Six',if(contains(outputs('Compose'),'Seven'),'Seven',''))))))
 
vyujincuimsft_0-1655705885910.pngvyujincuimsft_1-1655705962249.png

Result Screenshot:

vyujincuimsft_2-1655706056438.png

 

 

 

Best Regards,
Charlie Choi

View solution in original post

2 REPLIES 2
v-yujincui-msft
Community Support
Community Support

Hi @abbyamante ,

 

Maybe you could consider judging what specific keywords are contained in the message body and output the corresponding value.

 

I have made a simple test for your reference.

 

Here is my flow.

body('Get_message_details')?['body/plainTextContent']
 
if(contains(outputs('Compose'),'Two'),'Two',if(contains(outputs('Compose'),'Three'),'Three',if(contains(outputs('Compose'),'Four'),'Four',if(contains(outputs('Compose'),'Five'),'Five',if(contains(outputs('Compose'),'Six'),'Six',if(contains(outputs('Compose'),'Seven'),'Seven',''))))))
 
vyujincuimsft_0-1655705885910.pngvyujincuimsft_1-1655705962249.png

Result Screenshot:

vyujincuimsft_2-1655706056438.png

 

 

 

Best Regards,
Charlie Choi

Oh dear! I didn't realized there more simpler way. your method and functions is way more simple and efficient!

i just tried and it works! thank you very much!

 

 

Helpful resources

Announcements
Power Platform Conf 2022 768x460.jpg

Join us for Microsoft Power Platform Conference

The first Microsoft-sponsored Power Platform Conference is coming in September. 100+ speakers, 150+ sessions, and what's new and next for Power Platform.

New Ideas Forum MPA.jpg

A new place to submit your Ideas for Power Automate

Announcing a new way to share your feedback with the Power Automate Team.

MPA Virtual Workshop Carousel 768x460.png

Register for a Free Workshop

Learn to digitize and optimize business processes and connect all your applications to share data in real time.

Super User 2 - 2022 Congratulations 768x460.png

Welcome Super Users

The Super User program for 2022- Season 2 has kicked off!

Users online (2,907)