cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Mrudd
Frequent Visitor

When a new email arrives (V3) initialize variable string value from email subject.

With the 'When a new email arrives (V2)' for Outlook.com I can then initialize a variable with a simple expression such as:

 

concat(triggerBody()?['Subject'],triggerBody()?['From'])

 

However I can't do this with "When a new email arrives (V3)' for Office 365 Outlook.  It just returns null. Is it broken or do I have to use some other method?

 

How can I get the 'subject' into a string variable from this trigger?

 

Thanks

-Mike

1 ACCEPTED SOLUTION

Accepted Solutions
Mrudd
Frequent Visitor

For anyone searching, I found a way to get this.  I had to Initialize Variable and just make the value something that worked first. eg: triggerOutputs()?['Body']

 

Then below in an "apply to each" I could then use 'Set Variable' to select the dynamic content 'Subject' or any concat/substring expression.

 

-Mike 

View solution in original post

4 REPLIES 4
ekarim2020
Super User
Super User

Try the following, which is based on dynamic content:

concat(triggerOutputs()?['body/subject'],triggerOutputs()?['body/from'])

 

ekarim2020_0-1631316324333.png

Ellis

Mrudd
Frequent Visitor

Thanks for the suggestion.  I tried that, but it still returned blank.   I know we recently enabled MFA, could that be causing any kind of an issue?  I have already gone through and reauthorized my connections though.

 

Thanks

-Mike

Mrudd
Frequent Visitor

Also in the attempts. I tried to just select the dynamic content.  However PowerAutomate automatically wraps that in an 'Apply to each' object.  Then the initialize variable doesn't work.

Mrudd_0-1631556336748.png

 

Mrudd
Frequent Visitor

For anyone searching, I found a way to get this.  I had to Initialize Variable and just make the value something that worked first. eg: triggerOutputs()?['Body']

 

Then below in an "apply to each" I could then use 'Set Variable' to select the dynamic content 'Subject' or any concat/substring expression.

 

-Mike 

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.

365 EduCon 768x460.png

Microsoft 365 EduCon

Join us for two optional days of workshops and a 3-day conference, you can choose from over 130 sessions in multiple tracks and 25 workshops.

Users online (5,595)