cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jsurrette
Regular Visitor

Extract information from subject line of Gmail

I am building a new flow that pulls information from both the subject and body of the email. I have the flow for pulling the information I need from the body, but can't figure out how to extract just the information I need from the subject. 

 

The subject line is:
Typing Test Results for John Doe: additional text here

 

I want to pull only "John Doe" and have it entered into a Spreadsheet. 

 

The information is pulling from a Gmail account. This is currently what my flow looks like:

jsurrette_0-1634845866015.png

 

How would I trim the subject line? 

1 ACCEPTED SOLUTION

Accepted Solutions
VJR
Memorable Member
Memorable Member

Hi @jsurrette 

 

In that case use a single Compose action.

VJR_0-1634875011644.png

 

Below is what is written in the above Inputs using Expression

replace(first(split(triggerBody()['text'],':')),'Typing Test Results for ','')
 
The part in blue bold will be your dynamic content for the entire subject line coming from Gmail.
 
This is the output after running the flow
VJR_1-1634875149161.png

 

Ran another time with input as: 
Typing Test Results for Mr ABC: additional text here
 
This time it shows output as 
VJR_2-1634875260640.png

 

View solution in original post

3 REPLIES 3
VJR
Memorable Member
Memorable Member

HI @jsurrette 

 

Out of the below line which part is going to be fixed/constant?

 

Typing Test Results for John Doe: additional text here

 

1. Are the wordings "Typing Test Results for" going to be fixed?

2. Is the colon : after the name always going to be present?

jsurrette
Regular Visitor

Hello @VJR!

 

This is an automated email, so everything will be fixed with the exception of the name. It will always say the same thing, which is:

 

Typing Test Results for _____ ______: additional text here

VJR
Memorable Member
Memorable Member

Hi @jsurrette 

 

In that case use a single Compose action.

VJR_0-1634875011644.png

 

Below is what is written in the above Inputs using Expression

replace(first(split(triggerBody()['text'],':')),'Typing Test Results for ','')
 
The part in blue bold will be your dynamic content for the entire subject line coming from Gmail.
 
This is the output after running the flow
VJR_1-1634875149161.png

 

Ran another time with input as: 
Typing Test Results for Mr ABC: additional text here
 
This time it shows output as 
VJR_2-1634875260640.png

 

View solution in original post

Helpful resources

Announcements
UG GA Amplification 768x460.png

Launching new user group features

Learn how to create your own user groups today!

Community Connections 768x460.jpg

Community & How To Videos

Check out the new Power Platform Community Connections gallery!

M365 768x460.jpg

Microsoft 365 Collaboration Conference | December 7–9, 2021

Join us, in-person, December 7–9 in Las Vegas, for the largest gathering of the Microsoft community in the world.

Users online (1,808)